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



acmd - GeneralAref - 20.12.2015

this is my acmd command but given me 2 warning and show me level 1 or 2 menu but my level 10.how to fix it?
PHP код:
CMD:acmd(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >=|| IsPlayerAdmin(playerid))
    {
        new 
admlvl;
        if (
sscanf(params"i",admlvl)) return SendClientMessage(playeridCOLOR_RED"USAGE: /acmd [adminlevel]");
        if (
admlvl 10 || admlvl 0) return SendClientMessage(playeridCOLOR_RED,"[ERROR]: Valid Admin Levels: 1-10!");
        if(
PlayerInfo[playerid][pAdmin] = 1) return SendClientMessage(playeridCOLOR_RED,"This command menu number only for admin level 1!");
        {
            if(
admlvl == 1)
            {
              
ShowPlayerDialog(playerid1DIALOG_STYLE_LIST"Admin command""/kick\n/spec\n/specoff\n/reports\n/chr\n/warn\n/unwarn\n/asay""Close""");
            }
        }
        if(
PlayerInfo[playerid][pAdmin] = 2) return SendClientMessage(playeridCOLOR_RED,"This command menu number only for admin level 2!");
        {
            if(
admlvl == 2)
              {
             
ShowPlayerDialog(playerid2DIALOG_STYLE_LIST"Admin command""/kick\n/ban\n/oban\n/unban\n/freeze\n/unfreeze\n/mute\n/unmute\n/spec\n/specoff\n/reports\n/chr\n/warn\n/unwarn\n/asay""Close""");
            }
        }
         return 
1;
    }
    else return 
SendClientMessage(playerid,COLOR_RED,"You do not have permission to use this command!");




Re: acmd - SaltySandy - 20.12.2015

Mind dropping the errors? Eases up our lifes!


Re: acmd - NourNN - 20.12.2015

PHP код:
CMD:acmd(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >=|| IsPlayerAdmin(playerid))
{
if(
adminlevel()
strcat(admin,.....,....\
and make like levels 1 and 2


Re: acmd - GeneralAref - 20.12.2015

Код:
C:\Users\Aref\Desktop\Aref\sampserver\pawno\CODv2.pwn(1262) : warning 211: possibly unintended assignment
C:\Users\Aref\Desktop\Aref\sampserver\pawno\CODv2.pwn(1269) : warning 211: possibly unintended assignment



Re: acmd - GeneralAref - 20.12.2015

Quote:
Originally Posted by NourNN
Посмотреть сообщение
PHP код:
CMD:acmd(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >=|| IsPlayerAdmin(playerid))
{
if(
adminlevel()
strcat(admin,.....,....\
and make like levels 1 and 2
im not understand this.


Re: acmd - SaltySandy - 20.12.2015

PHP код:
if(PlayerInfo[playerid][pAdmin] = 2) return SendClientMessage(playeridCOLOR_RED,"This command menu number only for admin level 2!"); 
PHP код:
if(PlayerInfo[playerid][pAdmin] == 2) return SendClientMessage(playeridCOLOR_RED,"This command menu number only for admin level 2!"); 



Re: acmd - Younes44 - 20.12.2015

Hello
Try this code xcd
Код HTML:
CMD:acmd(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >=1 || IsPlayerAdmin(playerid))
    {
        new admlvl;
        if (sscanf(params, "i",admlvl)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /acmd [adminlevel]");
        if (admlvl > 10 || admlvl < 0) return SendClientMessage(playerid, COLOR_RED,"[ERROR]: Valid Admin Levels: 1-10!");
        if(PlayerInfo[playerid][pAdmin] = 1) return SendClientMessage(playerid, COLOR_RED,"This command menu number only for admin level 1!");
        {
            if(admlvl == 1)
            {
              ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Admin command", "/kick\n/spec\n/specoff\n/reports\n/chr\n/warn\n/unwarn\n/asay", "Close", "");
            }
        }
        if(PlayerInfo[playerid][pAdmin] = 2) return 
SendClientMessage(playerid, COLOR_RED,"This command menu number only for admin level 2!");
        {
            if(admlvl == 2)
              {
             ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Admin command", "/kick\n/ban\n/oban\n/unban\n/freeze\n/unfreeze\n/mute\n/unmute\n/spec\n/specoff\n/reports\n/chr\n/warn\n/unwarn\n/asay", "Close", "");
            }
        }

    else return SendClientMessage(playerid,COLOR_RED,"You do not have permission to use this command!");
}



Re: acmd - jlalt - 20.12.2015

PHP код:
CMD:acmd(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >=|| IsPlayerAdmin(playerid))
    {
        new 
admlvl;
        if (
sscanf(params"i",admlvl)) return SendClientMessage(playeridCOLOR_RED"USAGE: /acmd [adminlevel]");
        if (
admlvl 10 || admlvl 1) return SendClientMessage(playeridCOLOR_RED,"[ERROR]: Valid Admin Levels: 1-10!");
        if(
admlvl == 1) {
           if(
PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playeridCOLOR_RED,"This command menu number only for admin level 1!");
           
ShowPlayerDialog(playerid1DIALOG_STYLE_LIST"Admin command""/kick\n/spec\n/specoff\n/reports\n/chr\n/warn\n/unwarn\n/asay""Close""");
        }
        if(
admlvl == 2) {
           if(
PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playeridCOLOR_RED,"This command menu number only for admin level 2!");
           
ShowPlayerDialog(playerid2DIALOG_STYLE_LIST"Admin command""/kick\n/ban\n/oban\n/unban\n/freeze\n/unfreeze\n/mute\n/unmute\n/spec\n/specoff\n/reports\n/chr\n/warn\n/unwarn\n/asay""Close""");
        }
        return 
1;
    } else return 
SendClientMessage(playerid,COLOR_RED,"You do not have permission to use this command!");




Re: acmd - GeneralAref - 20.12.2015

thanks