SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 12/05/2020, 11:56 PM   #1
PepeTheFrog
Little Clucker
 
Join Date: Dec 2016
Posts: 46
Reputation: 3
Question GangZone not working

I am trying to create a Gang Zone (Colored black / 0x000000AA) and show it for a player but it does not show at all in radar even in the map (Gang Zone colored black will act as a road in radar).

I successfully compile the gamemode (where the gang zone create and show was included) and received no any errors and warnings.

I ran the samp-server.exe and no indicated error (I am using nativechecker plugin) even in the server_log.txt

Here's the location of the gang zone I want to place:



I've tried other colors too but it is not working.
I also tried placing the creation of gang zone and show it to a player on a filterscript but still the same.

I don't know what is not working the Creation or Show or all of it.

Here's my code:

HTML Code:
#define COLOR_BLACK 0x000000AA
new slex_part1_zone;

public OnGameModeInit()
{
    SetGameModeText("SLEX 4.0");
    slex_part1_zone = GangZoneCreate(2903.1584, -768.6727, 3000.0000, -800.2560);
    
    return 1;
}

public OnPlayerSpawn(playerid)
{
    GangZoneShowForPlayer(playerid, slex_part1_zone, COLOR_BLACK);
    return 1;
}
PepeTheFrog is offline   Reply With Quote
Old 13/05/2020, 12:38 AM   #2
KamilPolska
Huge Clucker
 
Join Date: May 2016
Location: Poland
Posts: 494
Reputation: 5
Default Re: GangZone not working

This code works...

KamilPolska is offline   Reply With Quote
Old 13/05/2020, 12:53 AM   #3
PepeTheFrog
Little Clucker
 
Join Date: Dec 2016
Posts: 46
Reputation: 3
Default Re: GangZone not working

I found the cause of the problem, it is because I am using YSF plugin. Now i need to figure out how to fix it with YSF plugin included
PepeTheFrog is offline   Reply With Quote
Old 13/05/2020, 01:13 AM   #4
PepeTheFrog
Little Clucker
 
Join Date: Dec 2016
Posts: 46
Reputation: 3
Default Re: GangZone not working

Is someone knows how to create gang zones using YSF plugin? https://github.com/IllidanS4/YSF
PepeTheFrog is offline   Reply With Quote
Old 13/05/2020, 06:05 AM   #5
Shadow0707
Big Clucker
 
Join Date: Sep 2016
Posts: 92
Reputation: 7
Default Re: GangZone not working

PHP Code:
#define COLOR_BLACK 0x000000AA
new slex_part1_zone;

public 
OnPlayerConnect(playerid)
{
    
SetGameModeText("SLEX 4.0");
    
slex_part1_zone CreatePlayerGangZone(playerid2903.1584, -768.67273000.0000, -800.2560);
    
    return 
1;
}

public 
OnPlayerSpawn(playerid)
{
    
PlayerGangZoneShow(playeridslex_part1_zoneCOLOR_BLACK);
    return 
1;

this should do it.

EDIT: I tried your coordinates and it shows this.

PHP Code:
CreatePlayerGangZoneMaxXMaxY must be bigger than MinXMinYNot inversely!
CreatePlayerGangZone2903.158447, -768.6727293000.000000, -800.255981 
The error is understandable and can be easily fixed.
Shadow0707 is online now   Reply With Quote
Old 13/05/2020, 08:35 AM   #6
PepeTheFrog
Little Clucker
 
Join Date: Dec 2016
Posts: 46
Reputation: 3
Cool Re: GangZone not working

SOLVED!

Quote:
Originally Posted by Shadow0707 View Post
PHP Code:
#define COLOR_BLACK 0x000000AA
new slex_part1_zone;

public 
OnPlayerConnect(playerid)
{
    
SetGameModeText("SLEX 4.0");
    
slex_part1_zone CreatePlayerGangZone(playerid2903.1584, -768.67273000.0000, -800.2560);
    
    return 
1;
}

public 
OnPlayerSpawn(playerid)
{
    
PlayerGangZoneShow(playeridslex_part1_zoneCOLOR_BLACK);
    return 
1;

this should do it.

EDIT: I tried your coordinates and it shows this.

PHP Code:
CreatePlayerGangZoneMaxXMaxY must be bigger than MinXMinYNot inversely!
CreatePlayerGangZone2903.158447, -768.6727293000.000000, -800.255981 
The error is understandable and can be easily fixed.
It is now working! thank you dude! He're my snippet script code:

HTML Code:
public OnPlayerConnect(playerid)
{
    slex_part1_zone = CreatePlayerGangZone(playerid, 2903.1584, -800.2560, 13618.5732, -768.6727);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    PlayerGangZoneDestroy(playerid, slex_part1_zone);
	return 1;
}

public OnPlayerSpawn(playerid)
{
    PlayerGangZoneShow(playerid, slex_part1_zone, COLOR_BLACK);
	return 1;
}
PepeTheFrog is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hosting Issues - Y_ini saving/loading isn't working and OnDialogResponse isn't working. Aerotactics Server Support 3 30/03/2014 08:44 AM
gangzone not working braduz Help Archive 4 05/02/2010 04:06 PM
GangZone Loader not working _Vortex Help Archive 8 20/12/2009 07:11 PM
How to make a Gangzone Flash if one of the players of the gangzone spawn Bearfist Help Archive 0 09/04/2009 03:11 PM
GangZone help? Outbreak Help Archive 2 09/03/2009 09:56 PM


All times are GMT. The time now is 03:35 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.