Help with /dropmask +REP - 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)
+--- Thread: Help with /dropmask +REP (
/showthread.php?tid=567139)
Help with /dropmask +REP -
Trevor Gin - 11.03.2015
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;
}
Re: Help with /dropmask +REP -
CalvinC - 11.03.2015
Remove the switch and sscanf.
Re: Help with /dropmask +REP -
Trevor Gin - 11.03.2015
Please give me the new codes, i dont need errors
AW: Help with /dropmask +REP -
Kaliber - 11.03.2015
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