Some errors
#1

pawn Код:
if(strcmp(cmd, "/admincmds", true) == 0 || strcmp(cmd, "/acmd", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if (PlayerInfo[playerid][pAdmin] < 1)
            {
                SendClientMessage(playerid, COLOR_RED, "You're not authorized to use this command!");
                return 1;
            }
            new plevel = PlayerInfo[playerid][pAdmin];
            new Adminhelp1[] = "/example /example /example /example /example /example ";
            new Adminhelp2[] = "/example /example /example /example /example /example ";
            new Adminhelp3[] = "/example /example /example /example /example /example /example /example ";
            new Adminhelp4[] = "/example /example /example /example /example /example ";
            new Adminhelp5[] = "/example /example /example /example ";
            new Adminhelp6[] = "/example /example /example /example /example /example ";
            new Adminhelp1337[] = "/example /example /example /example /example /example /example ";
            new Adminhelp1338[] = "/example /example /example /example /example /example /example /example ";
            new Adminhelpchat[] = "Type #<text> for the admin chat, or @<text> for the gamemaster chat.";
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                if(plevel == 1)
                {
                    format(string,sizeof(string), "%s\n%s",Adminhelp1[],Adminhelpchat[]);
                    ShowPlayerDialog(playerid, 3168, DIALOG_STYLE_MSGBOX,"AVAILABLE COMMANDS:", string,"Ok");
                }
                else if(plevel == 2)
                {
                    format(string,sizeof(string), "%s\n%s\n%s",Adminhelp1[],Adminhelp2[],Adminhelpchat[]);
                    ShowPlayerDialog(playerid, 3168, DIALOG_STYLE_MSGBOX,"AVAILABLE COMMANDS:", string,"Ok");
                }
                else if(plevel == 3)
                {
                    format(string,sizeof(string), "%s\n%s\n%s\n%s",Adminhelp1[],Adminhelp2[],Adminhelp3[],Adminhelpchat[]);
                    ShowPlayerDialog(playerid, 3168, DIALOG_STYLE_MSGBOX,"AVAILABLE COMMANDS:", string,"Ok");
                }
                else if(plevel == 4)
                {
                    format(string,sizeof(string), "%s\n%s\n%s\n%s\n%s",Adminhelp1[],Adminhelp2[],Adminhelp3[],Adminhelp4[],Adminhelpchat[]);
                    ShowPlayerDialog(playerid, 3168, DIALOG_STYLE_MSGBOX,"AVAILABLE COMMANDS:", string,"Ok");
                }
                else if(plevel == 5)
                {
                    format(string,sizeof(string), "%s\n%s\n%s\n%s\n%s\n%s",Adminhelp1[],Adminhelp2[],Adminhelp3[],Adminhelp4[],Adminhelp5[],Adminhelpchat[]);
                    ShowPlayerDialog(playerid, 3168, DIALOG_STYLE_MSGBOX,"AVAILABLE COMMANDS:", string,"Ok");
                }
                else if(plevel == 6)
                {
                    format(string,sizeof(string), "%s\n%s\n%s\n%s\n%s\n%s\n%s",Adminhelp1[],Adminhelp2[],Adminhelp3[],Adminhelp4[],Adminhelp5[],Adminhelp6[],Adminhelpchat[]);
                    ShowPlayerDialog(playerid, 3168, DIALOG_STYLE_MSGBOX,"AVAILABLE COMMANDS:", string,"Ok");
                }
                else if(plevel == 1337)
                {
                    format(string,sizeof(string), "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s",Adminhelp1[],Adminhelp2[],Adminhelp3[],Adminhelp4[],Adminhelp5[],Adminhelp6[],Adminhelp1337[],Adminhelpchat[]);
                    ShowPlayerDialog(playerid, 3168, DIALOG_STYLE_MSGBOX,"AVAILABLE COMMANDS:", string,"Ok");
                }
                else if(plevel == 1338)
                {
                    format(string,sizeof(string), "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s",Adminhelp1[],Adminhelp2[],Adminhelp3[],Adminhelp4[],Adminhelp5[],Adminhelp6[],Adminhelp1337[],Adminhelp1338[],Adminhelpchat[]);
                    ShowPlayerDialog(playerid, 3168, DIALOG_STYLE_MSGBOX,"AVAILABLE COMMANDS:", string,"Ok");
                }
                return 1;
            }
            }
    }
im getting errors while trying to compile :S please help me
please try to detect what i did wrong in here

EDIT: i forgot to put on dialog response
pawn Код:
if(dialogid == 3168)
{
    if(response)
    {
        return 1;
    }
}
Reply
#2

What errors? Try removing one of the } under return 1;
Reply
#3

errors:
Код:
D:\Games\GTA San Andreas\Raptor's Roleplay\gamemodes\rg.pwn(3869) : warning 217: loose indentation
D:\Games\GTA San Andreas\Raptor's Roleplay\gamemodes\rg.pwn(3959) : warning 217: loose indentation
D:\Games\GTA San Andreas\Raptor's Roleplay\gamemodes\rg.pwn(24910) : warning 217: loose indentation
D:\Games\GTA San Andreas\Raptor's Roleplay\gamemodes\rg.pwn(61264) : error 029: invalid expression, assumed zero
D:\Games\GTA San Andreas\Raptor's Roleplay\gamemodes\rg.pwn(61265) : warning 202: number of arguments does not match definition
D:\Games\GTA San Andreas\Raptor's Roleplay\gamemodes\rg.pwn(61269) : error 029: invalid expression, assumed zero
D:\Games\GTA San Andreas\Raptor's Roleplay\gamemodes\rg.pwn(61270) : warning 202: number of arguments does not match definition
D:\Games\GTA San Andreas\Raptor's Roleplay\gamemodes\rg.pwn(61274) : error 029: invalid expression, assumed zero
D:\Games\GTA San Andreas\Raptor's Roleplay\gamemodes\rg.pwn(61275) : warning 202: number of arguments does not match definition
D:\Games\GTA San Andreas\Raptor's Roleplay\gamemodes\rg.pwn(61279) : error 029: invalid expression, assumed zero
D:\Games\GTA San Andreas\Raptor's Roleplay\gamemodes\rg.pwn(61280) : warning 202: number of arguments does not match definition
D:\Games\GTA San Andreas\Raptor's Roleplay\gamemodes\rg.pwn(61284) : error 029: invalid expression, assumed zero
D:\Games\GTA San Andreas\Raptor's Roleplay\gamemodes\rg.pwn(61285) : warning 202: number of arguments does not match definition
D:\Games\GTA San Andreas\Raptor's Roleplay\gamemodes\rg.pwn(61289) : error 029: invalid expression, assumed zero
D:\Games\GTA San Andreas\Raptor's Roleplay\gamemodes\rg.pwn(61290) : warning 202: number of arguments does not match definition
D:\Games\GTA San Andreas\Raptor's Roleplay\gamemodes\rg.pwn(61294) : error 029: invalid expression, assumed zero
D:\Games\GTA San Andreas\Raptor's Roleplay\gamemodes\rg.pwn(61295) : warning 202: number of arguments does not match definition
D:\Games\GTA San Andreas\Raptor's Roleplay\gamemodes\rg.pwn(61299) : error 029: invalid expression, assumed zero
D:\Games\GTA San Andreas\Raptor's Roleplay\gamemodes\rg.pwn(61300) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


8 Errors.
Reply
#4

Okay I think you'll may have to explain what codes are in the lines from 61264 + mate.
Reply
#5

of course this, but nvm
pawn Код:
if(strcmp(cmd, "/admincmds", true) == 0 || strcmp(cmd, "/acmd", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if (PlayerInfo[playerid][pAdmin] < 1)
            {
                SendClientMessage(playerid, COLOR_RED, "You're not authorized to use this command!");
                return 1;
            }
            new plevel = PlayerInfo[playerid][pAdmin];
            new Adminhelp1[] = "/example /example /example /example /example /example ";
            new Adminhelp2[] = "/example /example /example /example /example /example ";
            new Adminhelp3[] = "/example /example /example /example /example /example /example /example ";
            new Adminhelp4[] = "/example /example /example /example /example /example ";
            new Adminhelp5[] = "/example /example /example /example ";
            new Adminhelp6[] = "/example /example /example /example /example /example ";
            new Adminhelp1337[] = "/example /example /example /example /example /example /example ";
            new Adminhelp1338[] = "/example /example /example /example /example /example /example /example ";
            new Adminhelpchat[] = "Type #<text> for the admin chat, or @<text> for the gamemaster chat.";
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                if(plevel == 1)
                {
                    format(string,sizeof(string), "%s\n%s",Adminhelp1[],Adminhelpchat[]);
                    ShowPlayerDialog(playerid, 3168, DIALOG_STYLE_MSGBOX,"AVAILABLE COMMANDS:", string,"Ok");
                }
                else if(plevel == 2)
                {
                    format(string,sizeof(string), "%s\n%s\n%s",Adminhelp1[],Adminhelp2[],Adminhelpchat[]);
                    ShowPlayerDialog(playerid, 3168, DIALOG_STYLE_MSGBOX,"AVAILABLE COMMANDS:", string,"Ok");
                }
                else if(plevel == 3)
                {
                    format(string,sizeof(string), "%s\n%s\n%s\n%s",Adminhelp1[],Adminhelp2[],Adminhelp3[],Adminhelpchat[]);
                    ShowPlayerDialog(playerid, 3168, DIALOG_STYLE_MSGBOX,"AVAILABLE COMMANDS:", string,"Ok");
                }
                else if(plevel == 4)
                {
                    format(string,sizeof(string), "%s\n%s\n%s\n%s\n%s",Adminhelp1[],Adminhelp2[],Adminhelp3[],Adminhelp4[],Adminhelpchat[]);
                    ShowPlayerDialog(playerid, 3168, DIALOG_STYLE_MSGBOX,"AVAILABLE COMMANDS:", string,"Ok");
                }
                else if(plevel == 5)
                {
                    format(string,sizeof(string), "%s\n%s\n%s\n%s\n%s\n%s",Adminhelp1[],Adminhelp2[],Adminhelp3[],Adminhelp4[],Adminhelp5[],Adminhelpchat[]);
                    ShowPlayerDialog(playerid, 3168, DIALOG_STYLE_MSGBOX,"AVAILABLE COMMANDS:", string,"Ok");
                }
                else if(plevel == 6)
                {
                    format(string,sizeof(string), "%s\n%s\n%s\n%s\n%s\n%s\n%s",Adminhelp1[],Adminhelp2[],Adminhelp3[],Adminhelp4[],Adminhelp5[],Adminhelp6[],Adminhelpchat[]);
                    ShowPlayerDialog(playerid, 3168, DIALOG_STYLE_MSGBOX,"AVAILABLE COMMANDS:", string,"Ok");
                }
                else if(plevel == 1337)
                {
                    format(string,sizeof(string), "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s",Adminhelp1[],Adminhelp2[],Adminhelp3[],Adminhelp4[],Adminhelp5[],Adminhelp6[],Adminhelp1337[],Adminhelpchat[]);
                    ShowPlayerDialog(playerid, 3168, DIALOG_STYLE_MSGBOX,"AVAILABLE COMMANDS:", string,"Ok");
                }
                else if(plevel == 1338)
                {
                    format(string,sizeof(string), "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s",Adminhelp1[],Adminhelp2[],Adminhelp3[],Adminhelp4[],Adminhelp5[],Adminhelp6[],Adminhelp1337[],Adminhelp1338[],Adminhelpchat[]);
                    ShowPlayerDialog(playerid, 3168, DIALOG_STYLE_MSGBOX,"AVAILABLE COMMANDS:", string,"Ok");
                }
                return 1;
            }
            }
    }
but this
pawn Код:
new Adminhelp1[] = "/example /example /example /example /example /example ";
and this
pawn Код:
if(plevel == 1)
                {
                    format(string,sizeof(string), "%s\n%s",Adminhelp1[],Adminhelpchat[]);
                    ShowPlayerDialog(playerid, 3168, DIALOG_STYLE_MSGBOX,"AVAILABLE COMMANDS:", string,"Ok");
                }
are the errors
Reply
#6

You're using ShowPlayerDialog wrong

https://sampwiki.blast.hk/wiki/ShowPlayerDialog
Reply
#7

Quote:
Originally Posted by Black_Sun1
Посмотреть сообщение
of course this, but nvm
pawn Код:
if(strcmp(cmd, "/admincmds", true) == 0 || strcmp(cmd, "/acmd", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if (PlayerInfo[playerid][pAdmin] < 1)
            {
                SendClientMessage(playerid, COLOR_RED, "You're not authorized to use this command!");
                return 1;
            }
            new plevel = PlayerInfo[playerid][pAdmin];
            new Adminhelp1[] = "/example /example /example /example /example /example ";
            new Adminhelp2[] = "/example /example /example /example /example /example ";
            new Adminhelp3[] = "/example /example /example /example /example /example /example /example ";
            new Adminhelp4[] = "/example /example /example /example /example /example ";
            new Adminhelp5[] = "/example /example /example /example ";
            new Adminhelp6[] = "/example /example /example /example /example /example ";
            new Adminhelp1337[] = "/example /example /example /example /example /example /example ";
            new Adminhelp1338[] = "/example /example /example /example /example /example /example /example ";
            new Adminhelpchat[] = "Type #<text> for the admin chat, or @<text> for the gamemaster chat.";
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                if(plevel == 1)
                {
                    format(string,sizeof(string), "%s\n%s",Adminhelp1[],Adminhelpchat[]);
                    ShowPlayerDialog(playerid, 3168, DIALOG_STYLE_MSGBOX,"AVAILABLE COMMANDS:", string,"Ok");
                }
                else if(plevel == 2)
                {
                    format(string,sizeof(string), "%s\n%s\n%s",Adminhelp1[],Adminhelp2[],Adminhelpchat[]);
                    ShowPlayerDialog(playerid, 3168, DIALOG_STYLE_MSGBOX,"AVAILABLE COMMANDS:", string,"Ok");
                }
                else if(plevel == 3)
                {
                    format(string,sizeof(string), "%s\n%s\n%s\n%s",Adminhelp1[],Adminhelp2[],Adminhelp3[],Adminhelpchat[]);
                    ShowPlayerDialog(playerid, 3168, DIALOG_STYLE_MSGBOX,"AVAILABLE COMMANDS:", string,"Ok");
                }
                else if(plevel == 4)
                {
                    format(string,sizeof(string), "%s\n%s\n%s\n%s\n%s",Adminhelp1[],Adminhelp2[],Adminhelp3[],Adminhelp4[],Adminhelpchat[]);
                    ShowPlayerDialog(playerid, 3168, DIALOG_STYLE_MSGBOX,"AVAILABLE COMMANDS:", string,"Ok");
                }
                else if(plevel == 5)
                {
                    format(string,sizeof(string), "%s\n%s\n%s\n%s\n%s\n%s",Adminhelp1[],Adminhelp2[],Adminhelp3[],Adminhelp4[],Adminhelp5[],Adminhelpchat[]);
                    ShowPlayerDialog(playerid, 3168, DIALOG_STYLE_MSGBOX,"AVAILABLE COMMANDS:", string,"Ok");
                }
                else if(plevel == 6)
                {
                    format(string,sizeof(string), "%s\n%s\n%s\n%s\n%s\n%s\n%s",Adminhelp1[],Adminhelp2[],Adminhelp3[],Adminhelp4[],Adminhelp5[],Adminhelp6[],Adminhelpchat[]);
                    ShowPlayerDialog(playerid, 3168, DIALOG_STYLE_MSGBOX,"AVAILABLE COMMANDS:", string,"Ok");
                }
                else if(plevel == 1337)
                {
                    format(string,sizeof(string), "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s",Adminhelp1[],Adminhelp2[],Adminhelp3[],Adminhelp4[],Adminhelp5[],Adminhelp6[],Adminhelp1337[],Adminhelpchat[]);
                    ShowPlayerDialog(playerid, 3168, DIALOG_STYLE_MSGBOX,"AVAILABLE COMMANDS:", string,"Ok");
                }
                else if(plevel == 1338)
                {
                    format(string,sizeof(string), "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s",Adminhelp1[],Adminhelp2[],Adminhelp3[],Adminhelp4[],Adminhelp5[],Adminhelp6[],Adminhelp1337[],Adminhelp1338[],Adminhelpchat[]);
                    ShowPlayerDialog(playerid, 3168, DIALOG_STYLE_MSGBOX,"AVAILABLE COMMANDS:", string,"Ok");
                }
                return 1;
            }
            }
    }
but this
pawn Код:
new Adminhelp1[] = "/example /example /example /example /example /example ";
and this
pawn Код:
if(plevel == 1)
                {
                    format(string,sizeof(string), "%s\n%s",Adminhelp1[],Adminhelpchat[]);
                    ShowPlayerDialog(playerid, 3168, DIALOG_STYLE_MSGBOX,"AVAILABLE COMMANDS:", string,"Ok");
                }
are the errors
This should be
pawn Код:
new Adminhelp1[128] = { "/example /example /example /example /example /example " }; // You forgot the brackets and the size
Reply
#8

thanks guys, SOLVED
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)