Zone color reset each time i reconnect HELP
#1

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(playeridGangZone[TownHall], -1);
    
GangZoneShowForPlayer(playeridGangZone[RaceTrack], -1);
    
GangZoneShowForPlayer(playeridGangZone[SuperMarket], -1);
    
GangZoneShowForPlayer(playeridGangZone[CargoShip], -1);
    
GangZoneShowForPlayer(playeridGangZone[SkyScraper], -1);
    
GangZoneShowForPlayer(playeridGangZone[SecretHideout], -1);
    
GangZoneShowForPlayer(playeridGangZone[BmxYard], -1);
    
GangZoneShowForPlayer(playeridGangZone[GasStation], -1);
    
GangZoneShowForPlayer(playeridGangZone[LightHouse], -1);
    
GangZoneShowForPlayer(playeridGangZone[HugeMansion], -1); 
I know the above code not correct it set zone color to white everytime i connect, want you guys to help me
Reply
#2

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.
Reply
#3

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
Reply
#4

Anyone
Reply
#5

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;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)