PAWNO error 035
#1

LINES: 3247 - 3265
Код:
CMD:setfaction(playerid, params[])
{
	new id, ammount, name[MAX_PLAYER_NAME], sendername[MAX_PLAYER_NAME], string[128];
	if(PlayerInfo[playerid][pAdmin] > 1) return SCM(playerid, COLOR_GREY, "unauthorized");
	else if(sscanf(params,"ui", id, ammount)) return SCM(sendername, COLOR_GREY, "Usage: /setfaction [playerid/PoN] [Faction ID]");
	else if (ammount > 3 || ammount < 0) return SCM(sendername, COLOR_GREY, "Only factions 0-3");
	else if(!IsPlayerConnected(id)) return SCM(sendername, COLOR_RED, "Player not connected or logged in");
	else
	{
	    GetPlayerName(playerid, sendername, sizeof(sendername));
	    GetPlayerName(id, name, sizeof(name));
	    PlayerInfo[id][pTeam] = ammount;
		format(string, sizeof(string),"{006600}[AdmCmd]{FFFFFF} Admin %s added you to Faction %i.", sendername, ammount);
		SendClientMessage(id, COLOR_WHITE,string);
		format(string,sizeof(string),"You added %s to Faction %i.", name, ammount);

	}
	return 1;
}
"factions"/teams are defined.

Can't figure out what is causing the error.

Код:
C:\Users\Scoot\Desktop\Roleplay\gamemodes\rp.pwn(3251) : error 035: argument type mismatch (argument 1)
C:\Users\Scoot\Desktop\Roleplay\gamemodes\rp.pwn(3252) : error 035: argument type mismatch (argument 1)
C:\Users\Scoot\Desktop\Roleplay\gamemodes\rp.pwn(3253) : error 035: argument type mismatch (argument 1)
Reply
#2

All errors are in it :- ammount
You should add an enum for it, not a define.
Reply
#3

All errors are at the SCM. You should put "playerid" instead on "sendername":

pawn Код:
if(sscanf(params, "iu", id, ammount)) return SCM(playerid, COLOR_GREY, "Usage: /setfaction [playerid/PoN] [Faction ID]");
else if (ammount > 3 || ammount < 0) return SCM(playerid, COLOR_GREY, "Only factions 0-3");
else if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_RED, "Player not connected or logged in");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)