28.03.2011, 15:18
Basta colocar o comando "/sair" antes de desativar o uso dos comandos em arena:
E, em OnPlayerDeath:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/sair", true) == 0 && GetPVarInt(playerid, "NaArena") == 1 )
return SendClientMessage(playerid,Cor,"Vocк saiu!"),
SetPVarInt(playerid, "NaArena",0);
if(GetPVarInt(playerid, "NaArena") == 1)
return SendClientMessage(playerid,Cor,"Vocк nгo pode usar comandos na Arena!");
if(strcmp(cmdtext, "/arena", true) == 0 && GetPVarInt(playerid, "NaArena") == 0 )
{
if(IsPlayerInAnyVehicle(playerid))
return SendClientMessage(playerid,Cor,"Vocк nгo pode ir a Arena em um veнculo!");
SetPlayerPos(playerid, 1677.4564,-1337.7351,158.4766);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 16, 50);
GivePlayerWeapon(playerid, 31, 100000);
GivePlayerWeapon(playerid, 26, 100000);
GivePlayerWeapon(playerid, 32, 100000);
SetPlayerHealth(playerid, 100.0);
SetPlayerArmour(playerid, 100.0);
SetPVarInt(playerid, "NaArena",1);
return 1;
}
//Outros comandos.
return 0;
}
pawn Код:
if(GetPVarInt(playerid, "NaArena") == 1) SetPVarInt(playerid, "NaArena",0);