24.09.2017, 21:05
(
Последний раз редактировалось Loinal; 20.01.2018 в 07:15.
)
fixed
if(type < 1 || type > 13) return SendClientMessage(playerid,COLOR_RED,"Type of explosin [1 to 13]");
This line is the issue
PHP код:
Also the SAMP Wiki page has a very detailed explination on control structures: https://sampwiki.blast.hk/wiki/Control_Structures |
COMMAND:explode(playerid, params[])
{
if(pData[playerid][Admin] >= 3)
{
new bombid, type;
if(sscanf(params, "ii", bombid,type)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /explode [name/id] [type]");
if(!IsPlayerConnected(bombid)) return SendClientMessage(playerid, COLOR_RED, "Player not found.");
if(type < 1 || type > 13) return SendClientMessage(playerid,COLOR_RED,"Type of explosin [1 to 13]");
else
{
new Float:x,Float:y,Float:z,str[280],ircMsg[280];
GetPlayerPos(bombid,x,y,z);
CreateExplosion(x,y,z,type,5);
format(str,sizeof(str), "You have exploded %s (ID: %d) [Type: %d]",GetName(bombid),bombid, type);
SendClientMessage(playerid,COLOR_GREEN,str);
format(ircMsg, sizeof(ircMsg), "1,8 Admin %s (ID: %d) exploded %s (ID: %d) with explosin (Type %d)", GetName(playerid), playerid, GetName(bombid),bombid, type);
IRC_GroupSay(groupID, IRC_CHANNEL, ircMsg);
}
return 1;
}
else
{
return ShowMessage(playerid, COLOR_YELLOW, 1, 3);
}
}
if(sscanf(params, "uu", bombid,type)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /explode [name/id] [type]"); //This is wrong, "u" is for username/playerid
if(sscanf(params, "ud", bombid,type)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /explode [name/id] [type]"); //Do it like this, "d" is for integer