hi,
actually you can find this kind of commands in every admin FS but here is a raw command structure that might help you for the start
pawn Код:
//OnPlayerCommandText(Performed)
dcmd(spec,4,cmdtext);
dcmd(specoff,7,cmdtext);
//Commands using dcmd and sscanf (required includes!)
dcmd_spec(playerid,params[])
{
if(IsPlayerAdmin(playerid))
{
new id;
if(sscanf(params,"u",id))return SendClientMessage(playerid,0xFF0000FF,"Usage: /spec[ID]");
if(!IsPlayerConnected(id))return SendClientMessage(playerid,0xFF0000FF,"Player ID/Name not found!");
if(id == playerid)return SendClientMessage(playerid,0xFF0000FF,"You can't spectate yourself!");
if(id == INVALID_PLAYER_ID)return SendClientMessage(playerid,0xFF0000FF,"Invalid PlayerID!");
new string[64],name[24];
GetPlayerName(id,name,24);
SetPlayerInterior(playerid,GetPlayerInterior(id));
TogglePlayerSpectating(playerid,true);
PlayerSpectatePlayer(playerid,id);
format(string,sizeof(string),"You are now spectating player: %s",name);
SendClientMessage(playerid,0xFF0000FF,string);
}else return SendClientMessage(playerid, 0xFF0000FF, "You are not an admin!");
return 1;
}
dcmd_specoff(playerid,params[])
{
#pragma unused params
if(IsPlayerAdmin(playerid))
{
TogglePlayerSpectating(playerid,false);
SetCameraBehindPlayer(playerid);
SendClientMessage(playerid,0xFF0000FF,"You have turned the spectating mode off.");
}else return SendClientMessage(playerid, 0xFF0000FF, "You are not an admin!");
return 1;
}
Is that the kind of commands you have requested?