SA-MP Forums Archive
Set 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: Set skin.. (/showthread.php?tid=408319)



Set skin.. - b0b - 17.01.2013

How i make a /setskin CMD?


I know this

CMDetskin

No more..


Re: Set skin.. - azzerking - 17.01.2013

Try this

pawn Код:
COMMAND:myskin(playerid,params[])
{
    if ( sscanf( params, "d", params[ 0 ] ) ) return SendClientMessage( playerid, -1, ""COL_LIGHTBLUE"Usage:{FFFFFF} /myskin <skin>");

    if ( !IsValidSkin( params[ 0 ] ) ) return SendClientMessage( playerid, -1, ""COL_RED"ERROR:{FFFFFF} Invalid skin ID.");
       
    SetPlayerSkin(playerid, params[ 0 ]);
    Account[playerid][Skin] = params [ 0 ];

    new String[180];
    format( String, sizeof String, "{FFFFFF}You set your Skin to "COL_LIGHTBLUE"%d{FFFFFF} and it has been saved into your account succesfully!", params[ 0 ] );
    SendClientMessage( playerid, -1, String );
    return 1;
}



Re: Set skin.. - LarzI - 17.01.2013

Quote:
Originally Posted by azzerking
Посмотреть сообщение
Try this [code]
I'd rather recommend "trying" this: https://sampforum.blast.hk/showthread.php?tid=300397

Not only because the code you gave him wont work unless he has the associated variables, but because out of the code you gave him, without any explanation, he won't learn much. He might "learn" something, but by actually knowing how it works, he can then in future not only make a command to set a skin, but possibly more, like creating objects and so on.


Re: Set skin.. - azzerking - 17.01.2013

lol, yes it's very wise to learn this way of making commands. Its more efficient when scripting many commands. Also im sorry for making life so hard . I straight away assumed you had come across Scanff or ZCMD

Thanks for pointing that out Larzi


Re: Set skin.. - b0b - 17.01.2013

OKey, i test azzerking After this work i give you +1


Re: Set skin.. - b0b - 17.01.2013

Nope no work :S 4 error



LINE :
PHP код:
if ( sscanfparams"d"params] ) ) return SendClientMessageplayerid, -1""COLOR_BLUE"Usage:{FFFFFF} /myskin <skin>"); 
Error !
PHP код:
(397) : warning 219local variable "b" shadows a variable at a preceding level
(7151) : warning 209: function "SSCANF_OnPlayerDisconnect" should return a value
(59349) : error 001expected token"-string end-"but found "-identifier-"(59349) : warning 215expression has no effect
(59349) : error 001expected token";"but found "-string-"
(59349) : warning 215expression has no effect
(59349) : error 001expected token";"but found ")"
(59349) : fatal error 107too many error messages on one line 



Re: Set skin.. - b0b - 17.01.2013

UP
UP
UP


Re : Set skin.. - yusei - 17.01.2013

if ( sscanf( params, "d", params[ 0 ] ) ) return SendClientMessage( playerid, -1*3, "Usage:{FFFFFF} /myskin <skin>");


Re: Set skin.. - b0b - 17.01.2013

No work agen..


PHP код:
C:\Users\DELL\Desktop\GM  (3)\pawno\include\md5.inc(397) : warning 219local variable "b" shadows a variable at a preceding level
C
:\Users\DELL\Desktop\GM  (3)\gamemodes\gm.pwn(7151) : warning 209: function "SSCANF_OnPlayerDisconnect" should return a value
C
:\Users\DELL\Desktop\GM  (3)\gamemodes\gm.pwn(59350) : error 017undefined symbol "IsValidSkin"
C:\Users\DELL\Desktop\GM  (3)\gamemodes\gm.pwn(59350) : error 001expected token"-string end-"but found "-identifier-"
C:\Users\DELL\Desktop\GM  (3)\gamemodes\gm.pwn(59350) : warning 215expression has no effect
C
:\Users\DELL\Desktop\GM  (3)\gamemodes\gm.pwn(59350) : error 001expected token";"but found "-string-"
C:\Users\DELL\Desktop\GM  (3)\gamemodes\gm.pwn(59350) : fatal error 107too many error messages on one line 
Line!

PHP код:
 if ( !IsValidSkinparams] ) ) return SendClientMessageplayerid, -1*3""COLOR_RED"Viga:{FFFFFF} Wrong ID."); 
Thaks for helping!!


Re : Set skin.. - yusei - 17.01.2013

if ( !IsValidSkin( params[ 0 ] ) ) return SendClientMessage( playerid, -1*3, "Viga:{FFFFFF} Wrong ID.");


change too the line

format( String, sizeof String, "{FFFFFF}You set your Skin to "COL_LIGHTBLUE"%d{FFFFFF} and it has been saved into your account succesfully!", params[ 0 ] );

by


format( String, sizeof String, "{FFFFFF}You set your Skin to %d{FFFFFF} and it has been saved into your account succesfully!", params[ 0 ] );