explode
#1

fixed
Reply
#2

This line is the issue
PHP код:
if(type || type 13) return SendClientMessage(playerid,COLOR_RED,"Type of explosin [1 to 13]"); 
You have used the wronge ">" keys. What you have stated is "if type less then 1 || type more then 13" that cannot work. Try switching them around. Remember the crocodile "<" eats the biggest number

Also the SAMP Wiki page has a very detailed explination on control structures: https://sampwiki.blast.hk/wiki/Control_Structures
Reply
#3

Quote:
Originally Posted by AaronFarley
Посмотреть сообщение
This line is the issue
PHP код:
if(type || type 13) return SendClientMessage(playerid,COLOR_RED,"Type of explosin [1 to 13]"); 
You have used the wronge ">" keys. What you have stated is "if type less then 1 || type more then 13" that cannot work. Try switching them around. Remember the crocodile "<" eats the biggest number

Also the SAMP Wiki page has a very detailed explination on control structures: https://sampwiki.blast.hk/wiki/Control_Structures
same
Reply
#4

PHP код:
COMMAND:explode(playeridparams[])
{
        if(
pData[playerid][Admin] >= 3)
        {
        new 
bombidtype;
        if(
sscanf(params"ii"bombid,type)) return SendClientMessage(playeridCOLOR_RED"USAGE: /explode [name/id] [type]");
        if(!
IsPlayerConnected(bombid)) return SendClientMessage(playeridCOLOR_RED"Player not found.");
        if(
type || 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),bombidtype);
            
SendClientMessage(playerid,COLOR_GREEN,str);
            
format(ircMsgsizeof(ircMsg), "1,8 Admin %s (ID: %d) exploded %s (ID: %d) with explosin (Type %d)"GetName(playerid), playeridGetName(bombid),bombidtype);
            
IRC_GroupSay(groupIDIRC_CHANNELircMsg);
        }
    
        return 
1;
        }
        else
        {
           return 
ShowMessage(playeridCOLOR_YELLOW13);
        }

Try now, untested though. Also i maybe a lil drunk so ill try and help the best i can
Reply
#5

You were doing it wrong ..

PHP код:
if(sscanf(params"uu"bombid,type)) return SendClientMessage(playeridCOLOR_RED"USAGE: /explode [name/id] [type]"); //This is wrong, "u" is for username/playerid 
Replace it with this ...

PHP код:
if(sscanf(params"ud"bombid,type)) return SendClientMessage(playeridCOLOR_RED"USAGE: /explode [name/id] [type]");  //Do it like this, "d" is for integer 
Try it .. it should work now.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)