public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/procurar", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,10.0,246.783996,63.900199,1003.640625))
{
GetPlayerInterior(playerid)
new rand2 = random(sizeof(RandomGuns));
new rand3 = random(sizeof(RandomAmmo));
GivePlayerWeapon(playerid,RandomGuns[rand2][0],RandomAmmo[rand3][0]);
ApplyAnimation(playerid, "BOMBER","BOM_Plant_In",4.0,0,0,0,0,0);
}
else
{
SendClientMessage(playerid,VERMELHO,"{!} Vocк nгo pode procurar aqui.");
}
}
return 1;
}
if(GetPlayerInterior(playerid) != IDINTERIORDELEGACIA) return SendClientMessage(playerid, -1, "Vocк sу pode usar esse comando dentro da delegacia.");
new JaUsou[MAX_PLAYERS];
if (strcmp("/procurar", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,10.0,246.783996,63.900199,1003.640625))
{
if(JaUsou == 1) return SendClientMessage(playerid,-1,"O comando foi usado recentemente!");
{
GetPlayerInterior(playerid)
new rand2 = random(sizeof(RandomGuns));
new rand3 = random(sizeof(RandomAmmo));
GivePlayerWeapon(playerid,RandomGuns[rand2][0],RandomAmmo[rand3][0]);
ApplyAnimation(playerid, "BOMBER","BOM_Plant_In",4.0,0,0,0,0,0);
JaUsou = 1;
SetTimer("LiberarComando",10 * 1000,true);
}
else
{
SendClientMessage(playerid,VERMELHO,"{!} Vocк nгo pode procurar aqui.");
}
}
forward LiberarComando();
public LiberarComando()
{
JaUsou = 0;
return 1;
}
Sу esqueci de colocar pra checar o interior, mas isso tu coloca depois.
pawn Код:
|
//Topo
new bool:JaUsou[MAX_PLAYERS];
//Comando
if (strcmp("/procurar", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,10.0,246.783996,63.900199,1003.640625))
{
if(GetPlayerInterior(playerid) != INTERIOR DELEGACIA) return SendClientMessage(playerid,-1,"Vocк sу pode usar esse comando na delegacia!");
if(JaUsou[playerid]) return SendClientMessage(playerid,-1,"O comando foi usado recentemente!");
new rand2 = random(sizeof(RandomGuns));
new rand3 = random(sizeof(RandomAmmo));
GivePlayerWeapon(playerid,RandomGuns[rand2][0],RandomAmmo[rand3][0]);
ApplyAnimation(playerid, "BOMBER","BOM_Plant_In",4.0,0,0,0,0,0);
JaUsou[playerid] = true;
SetTimer("LiberarComando", MILISEGUNDOS, false, "i", playerid);
}
else
{
SendClientMessage(playerid,VERMELHO,"{!} Vocк nгo pode procurar aqui.");
}
}
//public
forward LiberarComando(playerid);
public LiberarComando(playerid)
{
JaUsou[playerid] = false;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/procurar", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,100.0,246.783996,63.900199,1003.640625))
{
if(GetPlayerInterior(playerid) != 6)
if(JaUsou[playerid]) return SendClientMessage(playerid,VERMELHO,"-> Espere um tempo para procurar novamente!");
JaUsou[playerid] = true;
SetTimerEx("LiberarProcurar", 10000, false, "i", playerid);
new rand2 = random(sizeof(RandomGuns));
new rand3 = random(sizeof(RandomAmmo));
ApplyAnimation(playerid, "BOMBER","BOM_Plant_In",4.0,0,0,0,0,0);
new string[128];
GivePlayerWeapon(playerid,RandomGuns[rand2][0],RandomAmmo[rand3][0]);
format(string,sizeof(string),"> %s encontrou uma arma.",Nome(playerid));
SendClientMessageToAll(AZUL,string);
}
else
{
SendClientMessage(playerid,VERMELHO,"-> Vocк nгo pode procurar aqui.");
}
}
return 1;
}
if (strcmp("/procurar", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,100.0,246.783996,63.900199,1003.640625))
{
if((GetPlayerInterior(playerid) != 6) || (GetPlayerInterior(playerid) != COORDE) || (GetPlayerInterior(playerid) != CORDE))
if(JaUsou[playerid]) return SendClientMessage(playerid,VERMELHO,"-> Espere um tempo para procurar novamente!");
JaUsou[playerid] = true;
SetTimerEx("LiberarProcurar", 10000, false, "i", playerid);
new rand2 = random(sizeof(RandomGuns));
new rand3 = random(sizeof(RandomAmmo));
ApplyAnimation(playerid, "BOMBER","BOM_Plant_In",4.0,0,0,0,0,0);
new string[128];
GivePlayerWeapon(playerid,RandomGuns[rand2][0],RandomAmmo[rand3][0]);
format(string,sizeof(string),"> %s encontrou uma arma.",Nome(playerid));
SendClientMessageToAll(AZUL,string);
}
else
{
SendClientMessage(playerid,VERMELHO,"-> Vocк nгo pode procurar aqui.");
}
}
@off Ah, tu estб jogando muito no servidor Project Apocalypse. UEHUHEHUHEUHE |