17.05.2010, 21:43
Nгo sei se й bem assim que queres, mas pode ser ъtil.
No inнcio do GameMode:
Agora na бrea dos comandos:
Faloow!
No inнcio do GameMode:
pawn Код:
new Espiando[MAX_PLAYERS];
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_GREY 0xAFAFAFAA
pawn Код:
if(strcmp(cmd, "/espiar", true) == 0)
{
if(IsPlayerAdmin(playerid)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "/espiar [playerid/Parte-do-Nick]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(!IsPlayerConnected(giveplayerid))
{
SendClientMessage(playerid, COLOR_GREY, " Jogador nгo conectado");
return 1;
}
if(giveplayerid == playerid)
{
SendClientMessage(playerid, COLOR_GREY, " Nгo й possнvel se espiar.");
return 1;
}
if(IsPlayerInAnyVehicle(giveplayerid))
{
GetPlayerName(giveplayerid, giveplayer,256);
format(string, sizeof(string), "Vocк estб espiando %s (ID: %d)", giveplayer, giveplayerid);
SendClientMessage(playerid, COLOR_WHITE, string);
TogglePlayerSpectating(playerid, 1);
PlayerSpectateVehicle(playerid, GetPlayerVehicleID(giveplayerid), SPECTATE_MODE_NORMAL);
Espiando[playerid] = 1;
return 1;
}
else
{
format(string, sizeof(string), "Vocк estб espiando %s (ID: %d)", giveplayer, giveplayerid);
SendClientMessage(playerid, COLOR_WHITE, string);
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, giveplayerid, SPECTATE_MODE_NORMAL);
Espiando[playerid] = 1;
}
}
return 1;
}
if(strcmp(cmd, "/pararespiar", true) == 0) {
if(IsPlayerAdmin(playerid) {
if(Espiando[playerid] == 0) {
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo estб espiando ninguйm");
return 1;
} else {
TogglePlayerSpectating(playerid, 0);
}
}
return 1;
}