command buggy,again
#1

Hello,wanted to make /promote,but its bugged,if i write anything,/safasfa,it will promote me to principal,(idk,if it was for id 0,cuz i was lonley in server).


Код:
	if(strcmp(cmd, "/promote", true) == 0)
	{
	if(IsPlayerConnected(playerid))
	{
	new giveplayer[MAX_PLAYER_NAME];
	new tmp[256];
	new idx;
	tmp = strtok(cmdtext, idx);
	if(!strlen(tmp))
	{
	SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /promote [playerid/PartOfName]");
	return 1;
	}
	new para1;
	para1 = strval(tmp);
	if(para1 != INVALID_PLAYER_ID)
	{
	if(IsPlayerConnected(para1))
	{
	if(IsPlayerAdmin(playerid))
	{
  new sendername[MAX_PLAYER_NAME];
	GetPlayerName(para1, giveplayer, sizeof(giveplayer));
	GetPlayerName(playerid, sendername, sizeof(sendername));
	new string[256];
	format(string, sizeof(string), " You have promoted %s to Principal.", giveplayer);
	SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
	PlayerInfo[playerid][fLeader] = 1;
	SetPlayerSkin(playerid,295);
	}
	else
	{
	SendClientMessage(para1, COLOR_YELLOW, "Error: Your not in the same gang!");
	}
	}
	else
	{
	SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command(leaders only)!");
	}
	}
	}
	return 1;
	}
Reply


Messages In This Thread
command buggy,again - by WardenCS - 05.04.2010, 20:00
Re: command buggy,again - by WardenCS - 06.04.2010, 14:02
Re: command buggy,again - by Hiddos - 06.04.2010, 14:36
Re: command buggy,again - by WardenCS - 06.04.2010, 14:43
Re: command buggy,again - by WardenCS - 06.04.2010, 17:32
Re: command buggy,again - by Norn - 06.04.2010, 18:18
Re: command buggy,again - by Mikep. - 06.04.2010, 18:18
Re: command buggy,again - by WardenCS - 06.04.2010, 18:51
Re: command buggy,again - by WardenCS - 07.04.2010, 12:05
Re: command buggy,again - by Jakku - 07.04.2010, 13:24

Forum Jump:


Users browsing this thread: 1 Guest(s)