16.09.2012, 09:29
I'm facing this problem since the first time I tried to create a captureable gangzone. I've created it and everything is perfect. But I can't fix this 1 little problem. After I captured a gangzone, it changed the color to my team's color. No problem here. But after I reconnect, gangzone color is not changed.
Does anyone know how to fix this problem?
pawn Код:
//at the top
#define usacolor 0x0000FF96
new zone1;
new capturing[MAX_PLAYERS];
new timerid;
new pickup1;
new timer = 10;
new team[MAX_PLAYERS];
#define usa 1
//ongamemodeinit
zone1 = GangZoneCreate(-611.5824, 2530.2256,-500.5136, 2627.2539);
pickup1 = CreateDynamicPickup(1313,19,-562.2616,2591.2383,53.5156,_,_,_,100);
public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
if(pickupid == pickup1)
{
if(team[playerid] == usa)
{
SendClientMessage(playerid,-1,"capturing...");
GangZoneFlashForAll(zone1,usacolor);
timerid = SetTimerEx("setzone",1000,true,"i",playerid);
capturing[playerid] = 1;
}
}
return 1;
}
forward setzone(playerid);
public setzone(playerid)
{
timer--;
if(timer == 0)
{
KillTimer(timerid);
GivePlayerMoney(playerid,100);
capturing[playerid] = 0;
if(team[playerid] == usa)
{
GangZoneShowForAll(zone1,usacolor);
}
}
return 1;
}