11.07.2010, 18:29
Hey guys
i need /spec command for rcon admin
please send code's
thanks.
i need /spec command for rcon admin
please send code's
thanks.
new whoIsHeSpectating[MAX_PLAYERS];
if(strcmp(cmd, "/spec", true) == 0) { if(!IsPlayerAdmin(playerid)) return 0; if (GetPlayerState(playerid)==9){ whoIsHeSpectating[playerid]=-1; TogglePlayerSpectating(playerid, 0); return 1; } new who,tmp[128]; tmp = strtok(cmdtext,idx); if (!strlen(tmp)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /spec [playerid]"); who = strval(tmp); if (!IsPlayerConnected(who)) return SendClientMessage(playerid,COLOR_RED,"Player is offline."); TogglePlayerSpectating(playerid, 1); whoIsHeSpectating[playerid]=who; if (IsPlayerInAnyVehicle(who)) PlayerSpectateVehicle(playerid, GetPlayerVehicleID(who)); else PlayerSpectatePlayer(playerid, who); return 1; }
for (new i=0;i<MAX_PLAYERS; i++){ if (whoIsHeSpectating[i]==playerid){ if (newstate==2 || newstate==3) PlayerSpectateVehicle(i, GetPlayerVehicleID(playerid)); else PlayerSpectatePlayer(i, playerid); } }
whoIsHeSpectating[playerid]=-1;