01.12.2013, 14:51
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;
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.
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; }
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.