Changing 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Changing skin (
/showthread.php?tid=166229)
Changing skin -
Shockey - 07.08.2010
Ok guys I wanna make a cmd /changeskin [Id]
but I only know how to use strcmp or whatever it is and is there antother way of making this quicker instead of going Lke this
f (strcmp("/changeskin 0", cmdtext, true, 10) == 0)
}
SetPlayerSkin(playerid, 0);*
return 1;
}
for everyskin
Re: Changing skin -
Ritchie999 - 07.08.2010
I don't know much about it, but you could try making a dialog that opens with the id of the skins, when you click a number and click OK it sets your skin.
Re: Changing skin -
Vince - 07.08.2010
Either use sscanf or strtok. Both are explained on the wiki and probably on the forums as well.
I do recommend using sscanf (with dcmd or zcmd), though, as I find it easier and much more efficient than using strtok.
Re: Changing skin -
(.Aztec); - 07.08.2010
Here it is usign ZCMD & sscanf, you can find the includes by doing a simple search.
pawn Код:
COMMAND:changeskin(playerid, params[])
{
new SkinID;
if(!sscanf(params, "u", SkinID))
{
SetPlayerSkin(playerid, SkinID);
}
else return SendClientMessage(playerid, color, "[USAGE] /ChangeSkin [Skin ID]");
return 1;
}
Re: Changing skin -
Shockey - 07.08.2010
Wow does that have everyskin in it
Re: Changing skin -
(.Aztec); - 07.08.2010
Quote:
Originally Posted by Shockey
Wow does that have everyskin in it
|
Yes. Apparently I can't attach an include, sadly.
Re: Changing skin -
Shockey - 07.08.2010
Wow thx =]
Re: Changing skin -
Daren_Jacobson - 08.08.2010
Quote:
Originally Posted by (.Aztec);
Here it is usign ZCMD & sscanf, you can find the includes by doing a simple search.
pawn Код:
COMMAND:changeskin(playerid, params[]) { new SkinID; if(!sscanf(params, "u", SkinID)) { SetPlayerSkin(playerid, SkinID); } else return SendClientMessage(playerid, color, "[USAGE] /ChangeSkin [Skin ID]"); return 1; }
|
why are you using "u" that is user, it should be "i".
pawn Код:
if (strcmp("/changeskin", cmdtext, true, 11) == 0)
{
SetPlayerSkin(playerid, strval(cmdtext[13]));
return 1;
}
I don't recommend using that, but there it is.
Re: Changing skin -
(.Aztec); - 08.08.2010
Quote:
Originally Posted by Daren_Jacobson
why are you using "u" that is user, it should be "i".
|
User is "u" in sscanf. "i" is for intervals.
Re: Changing skin -
r0b - 08.08.2010
i or d, both works. i = integer and d = decimal? u = user;s = string..and so on..