08.10.2017, 11:31
I got this spectate command not working..when i type it nothing happenes..
Код:
CMD:spec(playerid, params[]) { if (pInClass[playerid]) { return 1; } if (! IsPlayerAdmin(playerid) && pStats[playerid][userAdmin] < 1) { return SendClientMessage(playerid, COLOR_TOMATO, "You must be admin level 1+ to use this command."); } new targetid; if (sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_THISTLE, "USAGE: /spec [player]"); } if (targetid == playerid) { return SendClientMessage(playerid, COLOR_TOMATO, "You can't spectate to yourself."); } if (! IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_TOMATO, "The specified player is not conected."); } if (pInClass[targetid] && GetPlayerState(targetid) == PLAYER_STATE_SPECTATING) { return SendClientMessage(playerid, COLOR_TOMATO, "The specified player is not spawned."); } PlayerSpectatePlayer(playerid, targetid); new buf[150]; format(buf, sizeof(buf), "You are now spectating %s(%i).", ReturnPlayerName(targetid), targetid); SendClientMessage(playerid, COLOR_DODGER_BLUE, buf); SendClientMessage(playerid, COLOR_DODGER_BLUE, "You can type /specoff when you wish to stop spectating."); return 1; }