Problem with spec
#1

Hi
i have added an admin command spec player
not working
code:

Код:
CMD:spec(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] < 1&& !IsPlayerAdmin(playerid)) return 1;
	new targetid,pName[MAX_PLAYER_NAME];
	if(sscanf(params,"u", targetid)) return SendClientMessage(playerid, -1 , "Correct Usage: /spec[Playerid]");
	if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,COLOR_RED,"Player not connected.");
	GetPlayerName(targetid,pName,sizeof(pName));
	TogglePlayerSpectating(targetid, 1);
	new msg[126];
	format(msg,sizeof(msg),"[Spectate]You are spectating player %s",pName);
	SendClientMessage(playerid,COLOR_RED,msg);
	return 1;
}

CMD:specoff(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] < 1&& !IsPlayerAdmin(playerid)) return 1;
	new pName[MAX_PLAYER_NAME];
	TogglePlayerSpectating(targetid, 0);
	new msg[126];
	format(msg,sizeof(msg),"[Spectate]You are no more spectating player");
	SendClientMessage(playerid,COLOR_RED,msg);
	return 1;
}
Reply


Messages In This Thread
Problem with spec - by akib - 09.05.2017, 08:16
Respuesta: Problem with spec - by Ertouq - 09.05.2017, 08:39

Forum Jump:


Users browsing this thread: 1 Guest(s)