Set skin..
#1

How i make a /setskin CMD?


I know this

CMDetskin

No more..
Reply
#2

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;
}
Reply
#3

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.
Reply
#4

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
Reply
#5

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

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

UP
UP
UP
Reply
#8

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

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!!
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)