28.12.2012, 13:17
pawn Код:
if(strcmp(cmd, "/espiar", true) == 0 || strcmp(cmd, "/tv", true) == 0)
{
if(PlayerInfo[playerid][Level] >= 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "[ADMIN] /TV [playerid/Parte-do-Nick]");
return 1;
}
new give = ReturnUser(tmp);
if(!IsPlayerConnected(give))
{
SendClientMessage(playerid, COLOR_GREY, " Jogador nгo conectado");
return 1;
}
if(give == playerid)
{
SendClientMessage(playerid, COLOR_GREY, " Nгo й possнvel se espiar.");
return 1;
}
GetPlayerName(give, nome, sizeof(nome));
format(string, sizeof(string), "Vocк estб espiando %s (ID: %d)",nome, give);
SendClientMessage(playerid, COLOR_WHITE, string);
if(IsPlayerInAnyVehicle(give))
{
TogglePlayerSpectating(playerid, 1);
PlayerSpectateVehicle(playerid, GetPlayerVehicleID(give), SPECTATE_MODE_NORMAL);
Espiando[playerid] = 1;
}
else
{
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, give, SPECTATE_MODE_NORMAL);
Espiando[playerid] = 1;
}
}
return 1;
}