Help with /dropmask +REP
#1

How i can make this cmd /dropmask without type /dropmask 1 only /dropmask?

CMD codes:
Код:
CMD:dropmask(playerid, params[])
{
	new string[128], type;
	if(sscanf(params, "d", type))
	{
		SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /dropmask [type]");
		SendClientMessageEx(playerid, COLOR_GRAD2, "Types: 1 = Mask");
		return 1;
	}

	switch(type)
	{
		case 1:
		{
			if(PlayerInfo[playerid][pMask] == 0)
			{
				SendClientMessageEx(playerid, COLOR_GRAD2, "You don't have a Mask to drop.");
				return 1;
			}
			format(string, sizeof(string), "You have dropped your Mask");
			SendClientMessageEx(playerid, COLOR_WHITE, string);
			PlayerInfo[playerid][pMask] = 0;
			return 1;
		}
		default:
		{
			SendClientMessageEx(playerid, COLOR_WHITE, "Invalid license type! /dropmask [type]");
			SendClientMessageEx(playerid, COLOR_GRAD2, "Types: 1 = Mask");
		}
	}
	return 1;
}
Reply
#2

Remove the switch and sscanf.
Reply
#3

Please give me the new codes, i dont need errors
Reply
#4

Just write this:

Код:
CMD:dropmask(playerid)
{
    if(!PlayerInfo[playerid][pMask]) return SendClientMessage(playerid, COLOR_GRAD2, "You don't have a Mask to drop.");
    SendClientMessage(playerid, -1, "You have dropped your Mask");
    PlayerInfo[playerid][pMask] = 0;
    return 1;
}
Greekz
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)