23.11.2010, 18:48
I have a Derby system on my server!
Im setting a Pvar when i tp to the derby area ,like this
I also have a command to be able to exit the Derby Areas
With that Pvar i should disable autofixing at Derby areas,which actually works.
When i do /exitdb the autofix its still disabled!...
whats the problem?
Im setting a Pvar when i tp to the derby area ,like this
pawn Код:
if(!strcmp(cmd, "/derby"))
{
if(DMArea[playerid] == 1) return ShowPlayerDialog(playerid,1000,DIALOG_STYLE_MSGBOX,"TELE","Cannot teleport while at DM area","Exit","Cancel");
if(inderby[playerid] == 1) return ShowPlayerDialog(playerid,1000,DIALOG_STYLE_MSGBOX,"TELE","Cannot teleport while at a Derby area","Exit","Cancel");
inderby[playerid] = 1; PlayerDB[playerid] = 1;
HOP[playerid] = 1; SetPVarInt(playerid, "InDM", 1);
SendClientMessage(playerid,0xFF0000FF,"|-----------------------|");
SendClientMessage(playerid,lgreen,"~.:Derby Match:.~");
SendClientMessage(playerid,0xFF0000FF,"|-----------------------|");
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
format(msg,sizeof(msg),"%s [%i] has teleported to Derby Match!~[/derby]",name,playerid);
SendClientMessageToAll(COLOR_YELLOW,msg);
DestroyVehicle(veh[playerid]);
I also have a command to be able to exit the Derby Areas
pawn Код:
if(strcmp(cmdtext,"/exitdb",true)==0)
{
if(inderby[playerid] == 1)
{
if(GetPVarInt(playerid, "InDM"))
{
SetPlayerVirtualWorld(playerid,0); SetPlayerHealth(playerid,1000000);
PlayerInDm[playerid] = 0; DMArea[playerid] = 0; HOP[playerid] = 0; inderby[playerid] = 0;
SetPlayerInterior(playerid,0);
new rand;
rand = random(8);
rand++;
switch(rand)
{
case 1: SetPlayerPos(playerid, 2090.6289,2073.8262,10.8203);
case 2: SetPlayerPos(playerid,2025.2324,1008.1907,10.8203);
case 3: SetPlayerPos(playerid,2130.3479,1332.9777,10.8263);
case 4: SetPlayerPos(playerid, 2194.6714,1677.6198,12.3672);
case 5: SetPlayerPos(playerid,2281.2207,1394.5282,42.8203);
case 6: SetPlayerPos(playerid,1319.3940,1254.9871,10.8203);
case 7: SetPlayerPos(playerid,-1363.4878,-264.2943,14.1484);
case 8: SetPlayerPos(playerid,-1528.9470,536.7141,7.1797);
case 9: SetPlayerPos(playerid,-2624.2734,1402.2373,7.1016);
}
DeletePVar(playerid, "InDM");
}
return SendClientMessage(playerid,lgreen,"Exited...");
}
else
{
return SendClientMessage(playerid,red,"You are not into a Derby area!");
}
}
When i do /exitdb the autofix its still disabled!...
whats the problem?