Limitations to a Command.
#1

Afternoon,

I'm using DCMD to make my gamemode, and I've been getting to grips with scripting again (after not scripting for a good few years).

I've started off by making some simple commands to allow players to set their skins;

Код:
CMD:skin(playerid, params[])
{
new skinid, string[128];
if(sscanf(params, "d", skinid))
{
SendClientMessage(playerid, COLOR_RED, "USAGE: /s(kin) [skinID].");
}
else
{
SetPlayerSkin(playerid, skinid);
format(string, sizeof(string), "You have set your skinID to %d.", skinid);
SendClientMessage(playerid, COLOR_GREEN, string);
}
return 1;
}
However, If someone types a skinid above 299, it will crash their game.
How do I stop this? I've seen it before in a script where people have used > and < , but it'd be nice If someone could explain this to me or point me at a decent tutorial.

Cheers.
Reply


Messages In This Thread
Limitations to a Command. - by NoSoap - 01.12.2013, 14:51
Re: Limitations to a Command. - by SilentSoul - 01.12.2013, 14:58
Re: Limitations to a Command. - by Patrick - 01.12.2013, 15:02
Re: Limitations to a Command. - by NoSoap - 01.12.2013, 15:02
Re: Limitations to a Command. - by NoSoap - 01.12.2013, 17:10
Re: Limitations to a Command. - by SilentSoul - 01.12.2013, 17:17
Re: Limitations to a Command. - by Audi_Quattrix - 01.12.2013, 17:25
Re: Limitations to a Command. - by NoSoap - 01.12.2013, 17:40
Re: Limitations to a Command. - by SilentSoul - 01.12.2013, 17:45
Re: Limitations to a Command. - by NoSoap - 01.12.2013, 17:51

Forum Jump:


Users browsing this thread: 1 Guest(s)