26.08.2013, 12:43
I know this is basic scripting, but I'm sure it will help someone who's just starting out.
Ok, first things first, open Pawno and find "OnPlayerCommandText".
Once you've found that, it should look like this:
Ok, now we've done that you're going to need to know the ID of the skin you're wanting to use - Link to a list of all the skins availabe in sa-mp: https://sampwiki.blast.hk/wiki/Skins:All
Once you've found the skin ID you're wanting to use, make note of it and continue below.
Look carefully:
Finished example:
Hopefully that helped some people, thanks for viewing.
Ok, first things first, open Pawno and find "OnPlayerCommandText".
Code:
public OnPlayerCommandText(playerid, cmdtext[])
Code:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/mycommand", cmdtext, true, 10) == 0) { // Do something here return 1; } return 0; }
Ok, now we've done that you're going to need to know the ID of the skin you're wanting to use - Link to a list of all the skins availabe in sa-mp: https://sampwiki.blast.hk/wiki/Skins:All
Once you've found the skin ID you're wanting to use, make note of it and continue below.
Look carefully:
Code:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/mycommand", cmdtext, true, 10) == 0)//Where it says "/mycommand", I suggest changing that to "/skin", this is the command you're going to type in-game to make your skin change. { // Do something here //This is where the scripting function will be going, here you need to write SetPlayerSkin(playerid, SKIN ID HERE); return 1; } return 0; }
Code:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/skin", cmdtext, true, 10) == 0) { SetPlayerSkin(playerid, 264);//This will change your skin to 264, which is the clown skin. return 1; } return 0; }