Changing skin
#1

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

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

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

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

Wow does that have everyskin in it
Reply
#6

Quote:
Originally Posted by Shockey
Посмотреть сообщение
Wow does that have everyskin in it
Yes. Apparently I can't attach an include, sadly.
Reply
#7

Wow thx =]
Reply
#8

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

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

i or d, both works. i = integer and d = decimal? u = user;s = string..and so on..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)