setskin Help
#1

When i compiled my script this error pops up, I don't know what is wrong with this
Код:
C:\Documents and Settings\JUN.DELL\My Documents\Downloads\Games Installer\Next Revolution Roleplay\Next Revolution Roleplay\gamemodes\NRRP.pwn(54302) : warning 209: function "cmd_setskin" should return a value
C:\Documents and Settings\JUN.DELL\My Documents\Downloads\Games Installer\Next Revolution Roleplay\Next Revolution Roleplay\gamemodes\NRRP.pwn(54303) : error 010: invalid function or declaration
C:\Documents and Settings\JUN.DELL\My Documents\Downloads\Games Installer\Next Revolution Roleplay\Next Revolution Roleplay\gamemodes\NRRP.pwn(54305) : error 021: symbol already defined: "SendClientMessageEx"
C:\Documents and Settings\JUN.DELL\My Documents\Downloads\Games Installer\Next Revolution Roleplay\Next Revolution Roleplay\gamemodes\NRRP.pwn(54307) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
CMD

Код:
CMD:setskin(playerid, params[])
{
	if (PlayerInfo[playerid][pAdmin] >= 3)
	{
		new string[128], giveplayerid, skinid;
		if(sscanf(params, "ud", giveplayerid, skinid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /setskin [player] [skinid]");

		if(IsPlayerConnected(giveplayerid))
		{
				if(GetPlayerSkin(giveplayerid) == skinid)
				{
					SendClientMessageEx( playerid, COLOR_WHITE, "The player you're trying to change skins of already is using the skin you're trying to set." );
				}
				else
				{
					PlayerInfo[giveplayerid][pChar] = skinid;
					PlayerInfo[giveplayerid][pModel] = skinid;
					format(string, sizeof(string), "Your skin has been changed to ID %d by Administrator %s.", skinid, GetPlayerNameEx(playerid));
					SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
					format(string, sizeof(string), "You have given %s skin ID %d.", GetPlayerNameEx(giveplayerid), skinid);
					SendClientMessageEx(playerid, COLOR_WHITE, string);
					SetPlayerSkin(giveplayerid, PlayerInfo[giveplayerid][pChar]);
				}
			}
			else
			{
				SendClientMessageEx(playerid, COLOR_GREY, "Invalid skin ID!");
			}
		}
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
	}
	return 1;
}
Reply
#2

Why are you using SendClientMessageEx?? Why not use SendClientMessage??
Because SendClientMessageEx is causing all your problems..
Reply
#3

Post those four lines too. About the first one, you're missing return 0 or return 1 at the completion of that command.
Reply
#4

this is the errors with lines

Reply
#5

anyone? i will give 1+REP WHO WILL HELP ME
Reply
#6

remove the brace at that line!!
no rep needed

just indent your code properly and you can see the error very clear
Reply
#7

Thanks Jonny5 you get my +rep no errors now
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)