Zone color reset each time i reconnect HELP -
SalmaN97 - 28.02.2015
Hello i am making a capturable zone system i followed this tutorial everything working fine :
https://sampforum.blast.hk/showthread.php?tid=370571
But the problem is when i reconnect zone color reset but when i try to capture zone it says zone already captured by your team, so my question is is there any way zone color stays the same even after reconnect?
this is my GangZoneShowForPlayer :
Its in onplayerconnect, i tryed to put this code in onplayerspawn but color rested after death:
PHP код:
GangZoneShowForPlayer(playerid, GangZone[TownHall], -1);
GangZoneShowForPlayer(playerid, GangZone[RaceTrack], -1);
GangZoneShowForPlayer(playerid, GangZone[SuperMarket], -1);
GangZoneShowForPlayer(playerid, GangZone[CargoShip], -1);
GangZoneShowForPlayer(playerid, GangZone[SkyScraper], -1);
GangZoneShowForPlayer(playerid, GangZone[SecretHideout], -1);
GangZoneShowForPlayer(playerid, GangZone[BmxYard], -1);
GangZoneShowForPlayer(playerid, GangZone[GasStation], -1);
GangZoneShowForPlayer(playerid, GangZone[LightHouse], -1);
GangZoneShowForPlayer(playerid, GangZone[HugeMansion], -1);
I know the above code not correct it set zone color to white everytime i connect, want you guys to help me
Re: Zone color reset each time i reconnect HELP -
CalvinC - 28.02.2015
Well, you show it as a white color, AKA -1 when the player connects.
You should store which team captures it, and depending on that, show different colors instead of -1.
Re: Zone color reset each time i reconnect HELP -
SalmaN97 - 28.02.2015
Quote:
Originally Posted by CalvinC
Well, you show it as a white color, AKA -1 when the player connects.
You should store which team captures it, and depending on that, show different colors instead of -1.
|
So i need to make enums and all that things? and if you can just give a little example i would be grateful
Re: Zone color reset each time i reconnect HELP -
SalmaN97 - 09.03.2015
Anyone
Re: Zone color reset each time i reconnect HELP -
ReD_HunTeR - 09.03.2015
Edit following things:-
TEAM 1, TEAM 2, TEAM 3, Put ur team defines
Add YOur ZOne names
pawn Код:
public OnPlayerConnect(playerid)
{
if(tCheck[Zone] == TEAM_1) GangZoneShowForPlayer(playerid, Zone[OLD], TEAM_1_ZONECOLOR);
else if(tCheck[Zone] == TEAM_2) GangZoneShowForPlayer(playerid, Zone[OLD], TEAM_2_ZONECOLOR);
else if(tCheck[Zone] == TEAM_3) GangZoneShowForPlayer(playerid, Zone[OLD], TEAM_3_ZONECOLOR);
return 1;
}