[HELP] /skin - 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: [HELP] /skin (
/showthread.php?tid=352812)
[HELP] /skin -
mickos - 21.06.2012
Hello,
I got a skin changer I mean /skin <id>
But I got 4 errors and I dont know how to fix it.
Here is the code:
PHP код:
//******************************************************************************
// Skin change
//******************************************************************************
#include <a_samp>
#include <zcmd>
#include <sscanf>
COMMAND:skin(playerid,params[])
{
if ( sscanf( params, "d", params[ 0 ] ) ) return SendClientMessage( playerid, -1, ""0xCCFFDD56"* Sorry you must be type /skin <id>");
if ( !IsValidSkin( params[ 0 ] ) ) return SendClientMessage( playerid, -1, ""0xFFA600"ERROR:{FFFFFF} Invalid skin ID.");
SetPlayerSkin(playerid, params[ 0 ]);
Account[playerid][Skin] = params [ 0 ];
new String[180];
format( String, sizeof String, "* You set your skin to "0xFFFB00"%d and it has been saved into your account succesfully!", params[ 0 ] );
SendClientMessage( playerid, -1, String );
return 1;
}
#endif
Here are the errors:
PHP код:
C:\Users\Edward\Desktop\samp server mick en roy\pawno\skinc.pwn(14) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\Edward\Desktop\samp server mick en roy\pawno\skinc.pwn(14) : warning 215: expression has no effect
C:\Users\Edward\Desktop\samp server mick en roy\pawno\skinc.pwn(14) : error 001: expected token: ";", but found "-string-"
C:\Users\Edward\Desktop\samp server mick en roy\pawno\skinc.pwn(14) : warning 215: expression has no effect
C:\Users\Edward\Desktop\samp server mick en roy\pawno\skinc.pwn(14) : error 001: expected token: ";", but found ")"
C:\Users\Edward\Desktop\samp server mick en roy\pawno\skinc.pwn(14) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
And this is line 14:
PHP код:
if ( sscanf( params, "d", params[ 0 ] ) ) return SendClientMessage( playerid, -1, ""0xCCFFDD56"* Sorry you must be type /skin <id>");
Hope you can help me.
Thanks
BEER-samp
Re: [HELP] /skin -
Skaizo - 21.06.2012
change the name from params[]
like
pawn Код:
new targetid;
if(sscanf(params, "d", targetid)) return SendClientMessage( playerid, COLOR_RED, "Sorry you must be type /skin <id>");
if(!IsValidSkin(targetid)) return SendClientMessage( playerid, COLOR_RED, "ERROR:{FFFFFF} Invalid skin ID.");
SetPlayerSkin(playerid, targetid);
Account[playerid][Skin] = targetid;
new String[180];
format(String, sizeof(String), "you set your skin to %d and it has been saved into your account succesfully!", targetid);
SendClientMessage(playerid, COLOR_RED, String);
return 1;
and...
Account[playerid][Skin] = params [ 0 ];
where is defined?and colour defined?
Re: [HELP] /skin -
rachit_rocks - 21.06.2012
here it is:
pawn Код:
new targetid;
if(sscanf(params, "d", targetid)) return SendClientMessage( playerid, -1, "Sorry you must be type /skin <id>");
if(!IsValidSkin(targetid)) return SendClientMessage( playerid, -1, "ERROR:{FFFFFF} Invalid skin ID.");
SetPlayerSkin(playerid, targetid);
Account[playerid][Skin] = targetid;
new String[180];
format(String, sizeof String, "you set your skin to %d and it has been saved into your account succesfully!", targetid);
SendClientMessage(playerid, -1, String);
return 1;