if(strcmp(cmdtext,"/sair",true)==0)
{
BlockCMD[playerid] = false;
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 24, 99999);
GivePlayerWeapon(playerid, 28, 99999);
GivePlayerWeapon(playerid, 26, 99999);
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,0);
GameTextForPlayer(playerid,"",4000,6);
SetPlayerInterior(playerid,0);
new rand = random(sizeof(RandomSpawns));
SetPlayerPos(playerid, RandomSpawns[rand][0], RandomSpawns[rand][1],RandomSpawns[rand][2]);
SetPlayerFacingAngle(playerid, RandomSpawns[rand][3]);
SetPlayerInterior(playerid,0);
SetPlayerWorldBounds(playerid,20000.0000,-20000.0000,20000.0000,-20000.0000);
SetPlayerInterior(playerid,0);
return 1;
}
Substitui o PlayerNaArena pela funcao que detecte se ele esta na arena. |
//Final do GameMode
stock IsPlayerInArena(playerid)
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
if(x >= 1271.44 && y >= 2092.145 && x <= 1384.68 && y <= 2208.187) return true; //Troque pela suas coordenadas
else return false;
}
// comando
if(strcmp(cmdtext,"/sair",true)==0)
{
if(!IsPlayerInArena(playerid)) return SendClientMessage(playerid, -1, "Vocк nгo estб em uma arena");
BlockCMD[playerid] = false;
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 24, 99999);
GivePlayerWeapon(playerid, 28, 99999);
GivePlayerWeapon(playerid, 26, 99999);
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,0);
GameTextForPlayer(playerid,"",4000,6);
SetPlayerInterior(playerid,0);
new rand = random(sizeof(RandomSpawns));
SetPlayerPos(playerid, RandomSpawns[rand][0], RandomSpawns[rand][1],RandomSpawns[rand][2]);
SetPlayerFacingAngle(playerid, RandomSpawns[rand][3]);
SetPlayerInterior(playerid,0);
SetPlayerWorldBounds(playerid,20000.0000,-20000.0000,20000.0000,-20000.0000);
SetPlayerInterior(playerid,0);
return 1;
}
new detectteleporte[MAX_PLAYERS];
public OnPlayerConnect
{
detectteleporte[playerid] = false;
}
public OnPlayerCommandText
{
if(strcmp(cmdtext,"/teleporte",true)==0)
{
detectteleporte[playerid] = true;
}
if strcmp(cmdtext,"/sair",true)==0)
{
if(detectteleporte[playerid] == 0) return SendClientMessage(playerid, 0xFFFFFAA, "[ERRO] Vocк sу pode usar esse comando em um teleporte");
// resto da funзгo
}
}
public OnPlayerSpawn
{
detectteleporte[playerid] = false;
}
new BlokioComandoEmoSz[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
if(BlokioComandoEmoSz[playerid] == 1 && strcmp(cmdtext, "/sairdm", true) != 0) return SendClientMessage(playerid, GetPlayerColor(playerid), "Vocк nгo pode digitar nenhum comando enquanto vocк estiver em uma Arena! /sairdm{FA0526} - 500$"),GameTextForPlayer(playerid,"~g~~h~ ~n~ ~n~ COMANDOS BLOQUEADO!", 3000, 3);
if(strcmp(cmdtext, "/sairdm",true)==0)
{
if(BlokioComandoEmoSz[playerid] == 0) return SendClientMessage(playerid, GetPlayerColor(playerid), "Vocк nгo pode digitar o comando /sairdm, pois voce nao esta em uma arena, seu emo!"), GameTextForPlayer(playerid,"~r~voce nao esta em uma arena emo!", 3000, 3);
SpawnPlayer(playerid);
return true;
}