07.12.2013, 18:49
PHP код:
if(strcmp(cmd, "/abordar", true) == 0 || strcmp(cmd, "/abordar", true) == 0)
{
tmp = strtok(cmdtext, idx);
giveplayerid = strval(tmp);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[playerid][pBOPE] = dini_Int(udb_encode(sendername), "levelbope");
PlayerInfo[giveplayerid][pBOPE] = dini_Int(udb_encode(giveplayer), "levelbope");
giveplayerid = strval(tmp);
if(!strlen(tmp) && PlayerInfo[playerid][pBOPE] >= 1)
{
SendClientMessage(playerid, Verde, "USO: /abordar [id do player]");
return 1;
}
if(Logado[playerid] == 1)
{
if(PlayerInfo[playerid][pBOPE] >= 1 || PlayerInfo[playerid][pPM] >= 1)
{
if(IsPlayerConnected(giveplayerid))
{
for(new i=0; i <= MAX_PLAYERS; i++)
if(GetDistanceBetweenPlayers(playerid, i) <= 20)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
// SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_HANDSUP);
freeze[giveplayerid] = 1;
format(string, sizeof(string), "O oficial %s abordou o jogador %s!", sendername,giveplayer);
SendClientMessageToAll(Amarelo, string);
format(string, sizeof(string), "O oficial %s abordou vocк!", sendername);
SendClientMessage(giveplayerid, Amarelo, string);
GameTextForPlayer(giveplayerid, "PARADO AI! POLICIA", 5000, 6);
new PlayerName[30];
GetPlayerName(playerid, PlayerName, 30);
printf("[Command] %s usou /abordar em %s.", PlayerName, giveplayer);
}
}
else
{
format(string, sizeof(string), "%d nгo й o nъmero de ID de um player ativo!", giveplayerid);
SendClientMessage(playerid, AzulEscuro, string);
}
}
else
{
SendClientMessage(playerid, AzulEscuro, "Vocк nгo й um Oficial/Militar para usar este comando !");
return 1;
}
}
else
{
SendClientMessage(playerid, Vermelho, "Vocк tem que estar logado para usar este comando!");
}