[HELP] /skin
#1

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 ( 
sscanfparams"d"params] ) ) return SendClientMessageplayerid, -1""0xCCFFDD56"* Sorry you must be type /skin <id>");
    if ( !
IsValidSkinparams] ) ) return SendClientMessageplayerid, -1""0xFFA600"ERROR:{FFFFFF} Invalid skin ID.");
    
SetPlayerSkin(playeridparams]);
    
Account[playerid][Skin] = params ];
    new 
String[180];
    
formatStringsizeof String"* You set your skin to "0xFFFB00"%d and it has been saved into your account succesfully!"params] );
    
SendClientMessageplayerid, -1String );
    return 
1;
}
#endif 
Here are the errors:

PHP код:
C:\Users\Edward\Desktop\samp server mick en roy\pawno\skinc.pwn(14) : error 001expected token"-string end-"but found "-identifier-"
C:\Users\Edward\Desktop\samp server mick en roy\pawno\skinc.pwn(14) : warning 215expression has no effect
C
:\Users\Edward\Desktop\samp server mick en roy\pawno\skinc.pwn(14) : error 001expected token";"but found "-string-"
C:\Users\Edward\Desktop\samp server mick en roy\pawno\skinc.pwn(14) : warning 215expression has no effect
C
:\Users\Edward\Desktop\samp server mick en roy\pawno\skinc.pwn(14) : error 001expected token";"but found ")"
C:\Users\Edward\Desktop\samp server mick en roy\pawno\skinc.pwn(14) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
4 Errors

And this is line 14:

PHP код:
if ( sscanfparams"d"params] ) ) return SendClientMessageplayerid, -1""0xCCFFDD56"* Sorry you must be type /skin <id>"); 
Hope you can help me.

Thanks

BEER-samp
Reply
#2

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?
Reply
#3

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;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)