Dialog help..
#1

Hello guys, I've two question, so here I've this code:

pawn Код:
CMD:shop(playerid, params[]); //zcmd defined.
{
    ShowPlayerDialog(playerid, DIALOG_WEPS, DIALOG_STYLE_LIST, "TEST", "AK-47\nM4\nMP5", "TEST", "TEST");
    return 1;
}
And I know something's missing but I can't find what since I looked everywhere and I didn't see WHAT is actually missing..

So I've this error messages:

pawn Код:
C:\Users\user\Desktop\HZ-Gaming\gamemodes\Hazard.pwn(100) : error 055: start of function body without function header
C:\Users\user\Desktop\HZ-Gaming\gamemodes\Hazard.pwn(102) : error 010: invalid function or declaration
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
The OnDialogResponse has no error lines, and here's the code itself..
pawn Код:
{
    if(dialogid == 1)
    {
        if(response)
        {
            switch(listitem)
            {
                case 0:
            {
                GivePlayerWeapon(playerid,24, 9999999);
            }
                case 1:
            {
                GivePlayerWeapon(playerid, 31, 500);
            }
                case 2:
            {
                GivePlayerWeapon(playerid, 29 ,9999999);
            }


            }
           
        }
    }
    return 1;
}
So I am not getting what's wrong with my script lol.

2nd question;

How can I use colors at any DIALOG_STYLE?



Thanks ahead.
Reply
#2

Bump...
Reply
#3

pawn Код:
CMD:shop(playerid, params[])
without ";"
Reply
#4

Nope, still fucked up
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    {
    CMD:Hello(playerid, params[])
    SendClientMessage(playerid, COLOR_RED, "Hi");
    return 1;
    }
   return 0;
}
Here's my error lines:

pawn Код:
C:\Users\user\Desktop\HZ-Gaming\gamemodes\BETA.pwn(130) : error 029: invalid expression, assumed zero
C:\Users\user\Desktop\HZ-Gaming\gamemodes\BETA.pwn(130) : error 017: undefined symbol "cmd_Hello"
C:\Users\user\Desktop\HZ-Gaming\gamemodes\BETA.pwn(130) : error 029: invalid expression, assumed zero
C:\Users\user\Desktop\HZ-Gaming\gamemodes\BETA.pwn(130) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Reply
#5

zcmd doesnt need to be used inside onplayercommandtext. Remove that callback. And the structure is:
pawn Код:
CMD:shop(playerid, params[])
{
//code
return 1;
}
Reply
#6

Quote:
Originally Posted by HurtLocker
Посмотреть сообщение
zcmd doesnt need to be used inside onplayercommandtext. Remove that callback. And the structure is:
pawn Код:
CMD:shop(playerid, params[])
{
//code
return 1;
}
Thank helped meh alot!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)