13.07.2010, 18:56
pawn Код:
CMD:spec(playerid, params[])
{
new playa, Name[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME],String[64];
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(!sscanf(params,"u",playa)) SendClientMessage(playerid,COLOR_GREY,"Lietojums: /spec <SpēlētājaID>");
else
{
if(IsPlayerConnected(playa))
{
if(playa == playerid){SendClientMessage(playerid,COLOR_RED,"Nevar novērot pats sevi!"); return 1;}
if(Specing[playa] == 1)
{SendClientMessage(playerid,COLOR_RED,"Spēlētājs kādu novēro, nevar novērot viņu, kamēr viņљ novēro!"); return 1;}
GetPlayerName(playerid, Name, sizeof(Name));
GetPlayerName(playa, Name2, sizeof(Name2));
format(String, sizeof(String), "[%i] %s is now spectating [%i] %s",playerid, Name,playa, Name2);
CallLocalFunction("ircRemoteSay", "iss", 1, "#FSE", String);
Specing[playerid] = 1;
if(!IsPlayerInAnyVehicle(playa))
{
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, playa);
SetPlayerInterior(playerid,GetPlayerInterior(playa));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(playa));
return 1;
}
else
{
TogglePlayerSpectating(playerid, 1);
PlayerSpectateVehicle(playerid, GetPlayerVehicleID(playa));
SetPlayerInterior(playerid,GetPlayerInterior(playa));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(playa));
return 1;
}
}
else {SendClientMessage(playerid,COLOR_GREY,"Spēlētājs ar tādu id neeksistē!");return 1;}
}
}
else {SendClientMessage(playerid,COLOR_GREY,"Tu nevari lietot љo komandu!");return 1;}
}