SA-MP Forums Archive
Reason - 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: Reason (/showthread.php?tid=657349)



Reason - Man43 - 05.08.2018

I've creating a command for explodeall but When an admin typing /explodeall They using the command without Giving the players the reason why? What I mean extacly? If an admin typing /explodeall he must add a reason to use this command Example: /explodeall Testing and then he can use the command If he typing /explodeall without a reason the command should not be working.

PHP код:
CMD:explodeall(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >= && 5)
    {
        new 
string[128], Float:xFloat:yFloat:z,explodeall[128];
        if(
sscanf(params"uii"explodeall)) SendClientMessage(playeridCOLOR_YELLOW"USAGE: /explodeall [Reason]");
        if(
PlayerInfo[playerid][pAdmin] < && 2) return SendClientMessage(playerid, -1"{FF0000}Error: {FFFFFF}Only Admin +level 3 can use this command.");
        {
            
GetPlayerPos(playeridx,y,z);
            
CreateExplosion(x,y,z,12,10.0);
            
format(string,sizeof(string), "{A82FED}[All Exploded]: {FFFFFF}All players has exploded by An Admin {A82FED}%s(%d){FFFFFF}! Reason: {A82FED}%s{FFFFFF}.",PlayerName(playerid), playeridparams);
            
SendClientMessageToAll(-1string); //Output the string to the client.
            
format(stringsizeof(string), "An Admin %s(%d) has Exploded All players Reason: %s. (/explodeall)!"PlayerName(playerid), playeridparams);
             
SendToAdmins(COLOR_GREY,string);
        }
    }
    else
        
SendClientMessage(playerid, -1"{FF0000}Error: {FFFFFF}Wrong command!! {FF0000}Check availables commands from here `{FFFFFF}/cmds{FF0000}`.");
    return 
1;




Re: Reason - RedRex - 05.08.2018

Try this.

PHP код:
CMD:explodeall(playeridparams[]) 

    if(
PlayerInfo[playerid][pAdmin] >= && 5
    { 
        new 
string[128], Float:xFloat:yFloat:z,explodeall[128]; 
        if(
sscanf(params"uii"explodeall)) return SendClientMessage(playeridCOLOR_YELLOW"USAGE: /explodeall [Reason]"); 
        if(
PlayerInfo[playerid][pAdmin] < && 2) return SendClientMessage(playerid, -1"{FF0000}Error: {FFFFFF}Only Admin +level 3 can use this command."); 
        { 
            
GetPlayerPos(playeridx,y,z); 
            
CreateExplosion(x,y,z,12,10.0); 
            
format(string,sizeof(string), "{A82FED}[All Exploded]: {FFFFFF}All players has exploded by An Admin {A82FED}%s(%d){FFFFFF}! Reason: {A82FED}%s{FFFFFF}.",PlayerName(playerid), playeridparams); 
            
SendClientMessageToAll(-1string); //Output the string to the client. 

            
format(stringsizeof(string), "An Admin %s(%d) has Exploded All players Reason: %s. (/explodeall)!"PlayerName(playerid), playeridparams); 
             
SendToAdmins(COLOR_GREY,string); 
        } 
    } 
    else 
        
SendClientMessage(playerid, -1"{FF0000}Error: {FFFFFF}Wrong command!! {FF0000}Check availables commands from here `{FFFFFF}/cmds{FF0000}`."); 
    return 
1

You just forget to type "Return"!


Re: Reason - DBZdabIt3Bro7 - 05.08.2018

Quote:
Originally Posted by RedRex
Посмотреть сообщение
Try this.

PHP код:
CMD:explodeall(playeridparams[]) 

    if(
PlayerInfo[playerid][pAdmin] >= && 5
    { 
        new 
string[128], Float:xFloat:yFloat:z,explodeall[128]; 
        if(
sscanf(params"uii"explodeall)) return SendClientMessage(playeridCOLOR_YELLOW"USAGE: /explodeall [Reason]"); 
        if(
PlayerInfo[playerid][pAdmin] < && 2) return SendClientMessage(playerid, -1"{FF0000}Error: {FFFFFF}Only Admin +level 3 can use this command."); 
        { 
            
GetPlayerPos(playeridx,y,z); 
            
CreateExplosion(x,y,z,12,10.0); 
            
format(string,sizeof(string), "{A82FED}[All Exploded]: {FFFFFF}All players has exploded by An Admin {A82FED}%s(%d){FFFFFF}! Reason: {A82FED}%s{FFFFFF}.",PlayerName(playerid), playeridparams); 
            
SendClientMessageToAll(-1string); //Output the string to the client. 
            
format(stringsizeof(string), "An Admin %s(%d) has Exploded All players Reason: %s. (/explodeall)!"PlayerName(playerid), playeridparams); 
             
SendToAdmins(COLOR_GREY,string); 
        } 
    } 
    else 
        
SendClientMessage(playerid, -1"{FF0000}Error: {FFFFFF}Wrong command!! {FF0000}Check availables commands from here `{FFFFFF}/cmds{FF0000}`."); 
    return 
1

You just forget to type "Return"!
no... just no... go away from this section..... :huge_face_palm:

PHP код:
CMD:explodeall(playeridparams[]) 

    if(
PlayerInfo[playerid][pAdmin] >= && 5
    { 
        new 
string[128], Float:xFloat:yFloat:z,explodeall[128]; 
        if(
sscanf(params"s[128]"explodeall)) return SendClientMessage(playeridCOLOR_YELLOW"USAGE: /explodeall [Reason]"); 
        if(
PlayerInfo[playerid][pAdmin] < && 2) return SendClientMessage(playerid, -1"{FF0000}Error: {FFFFFF}Only Admin +level 3 can use this command."); 
        { 
            
GetPlayerPos(playeridx,y,z); 
            
CreateExplosion(x,y,z,12,10.0); 
            
format(string,sizeof(string), "{A82FED}[All Exploded]: {FFFFFF}All players has exploded by An Admin {A82FED}%s(%d){FFFFFF}! Reason: {A82FED}%s{FFFFFF}.",PlayerName(playerid), playeridexplodeall); 
            
SendClientMessageToAll(-1string); //Output the string to the client. 
            
format(stringsizeof(string), "An Admin %s(%d) has Exploded All players Reason: %s. (/explodeall)!"PlayerName(playerid), playeridexplodeall); 
             
SendToAdmins(COLOR_GREY,string); 
        } 
    } 
    else 
        
SendClientMessage(playerid, -1"{FF0000}Error: {FFFFFF}Wrong command!! {FF0000}Check availables commands from here `{FFFFFF}/cmds{FF0000}`."); 
    return 
1

op: next time don't copy and paste a function, thinking it will work because you changed a string.


Re: Reason - RedRex - 05.08.2018

Quote:
Originally Posted by DBZdabIt3Bro7
Посмотреть сообщение
no... just no... go away from this section..... :huge_face_palm:
op: next time don't copy and paste a function, thinking it will work because you changed a string.
Exause me? I'm not copying & Paste anything I just helping him to fixed his problem. but Why Should I go? and go away of this section? I'm here to helping people too from a problems/errors. BTW I'm not changing anything I just adding `return` into it. anyway Thank you for your words.


Re: Reason - DBZdabIt3Bro7 - 05.08.2018

Quote:
Originally Posted by RedRex
Посмотреть сообщение
Exause me? I'm not copying & Paste anything I just helping him to fixed his problem. but Why Should I go? and go away of this section? I'm here to helping people too from a problems/errors. BTW I'm not changing anything I just adding `return` into it. anyway Thank you for your words.
you do realize i wrote "OP", and not "RED REX!!!!!!"!"#!#"!#" ARGHHH"