setskin Help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: setskin Help (
/showthread.php?tid=335416)
setskin Help -
sampmark05 - 18.04.2012
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;
}
Re: setskin Help -
Jstylezzz - 18.04.2012
Why are you using SendClientMessageEx?? Why not use SendClientMessage??
Because SendClientMessageEx is causing all your problems..
Re: setskin Help -
Mark™ - 18.04.2012
Post those four lines too. About the first one, you're missing return 0 or return 1 at the completion of that command.
Re: setskin Help -
sampmark05 - 19.04.2012
this is the errors with lines
Re: setskin Help -
sampmark05 - 19.04.2012
anyone? i will give 1+REP WHO WILL HELP ME
Re: setskin Help -
Jonny5 - 19.04.2012
remove the brace at that line!!
no rep needed
just indent your code properly and you can see the error very clear
Re: setskin Help -
sampmark05 - 19.04.2012
Thanks Jonny5 you get my +rep no errors now