/shout not working
#1

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(response)
        {
        switch(dialogid)
            {
                case 9001:
                {
                    if(strlen(inputtext) > 0)
                    {
                        new name[MAX_PLAYER_NAME], string[128];
                        GetPlayerName(playerid, name, sizeof(name));
                        format(string, sizeof(string), "VIP %s shouted: {00ffff}%s", name, inputtext);
                        SendClientMessageToAll(0xFFAA3300, string);
                    }
                    else
                    {
                        SendClientMessage(playerid, 0xFF000000, "Your shout needs to be more than 0 character!");
                    }
                }
            }
        }
    return 1;
}
Well, it's fine when I run it on test server, but I found that it didn't work on my server!
Reply
#2

Show me your ShowPlayerDialog
Reply
#3

Here, Joao.
pawn Код:
CMD:shout(playerid,params[])
{
    if(IsPlayerVipMember(playerid))
    {
    ShowPlayerDialog(playerid, 9001, DIALOG_STYLE_INPUT, "Shout", "What do you want to shout?", "Shout", "Cancel");
    }
    else SendClientMessage(playerid, 0xFF000000, "ERROR: You're not a VIP Member!");
    return 1;
}
Oh yeah, a mini question (off-topic): What is Jetpack animation (equipped)?
Reply
#4

I see no errors... What happen when you use this command?

jetpack:
Код:
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK)
Reply
#5

Joao, when I /shout, it shows me a dialog, but after I type some text on it, it doesn't work. If you really want to know, just join my server and you will know what's the problem. Maybe.
Reply
#6

Do a little debug

Insert
Код:
SendClientMessageToAll(-1, "teste")
before
Код:
if(strlen(inputtext) > 0)
thereby:
Код:
SendClientMessageToAll(-1, 'teste')
if(strlen(inputtext) > 0)
Reply
#7

Followed your step, but...
Код:
C:\Users\Kelvin\Desktop\Scripting\filterscripts\VIP.pwn(310) : error 027: invalid character constant
C:\Users\Kelvin\Desktop\Scripting\filterscripts\VIP.pwn(310) : error 017: undefined symbol "est"
C:\Users\Kelvin\Desktop\Scripting\filterscripts\VIP.pwn(310 -- 311) : warning 215: expression has no effect
C:\Users\Kelvin\Desktop\Scripting\filterscripts\VIP.pwn(311) : error 001: expected token: ";", but found "if"
C:\Users\Kelvin\Desktop\Scripting\filterscripts\VIP.pwn(311) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Ugh..
Reply
#8

Oh yeah, and the code.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(response)
        {
        switch(dialogid == 1)
            {
                case 9001:
                {
                    SendClientMessageToAll(-1, 'test')
                    if(strlen(inputtext) > 0)
                    {
                        new name[MAX_PLAYER_NAME], string[128];
                        GetPlayerName(playerid, name, sizeof(name));
                        format(string, sizeof(string), "VIP %s shouted: {00ffff}%s", name, inputtext);
                        SendClientMessageToAll(0xFFAA3300, string);
                    }
                    else
                    {
                        SendClientMessage(playerid, 0xFF000000, "Your shout needs to be more than 0 character!");
                    }
                }
            }
        }
    return 1;
}
Am I right? .__.
Reply
#9

swap 'teste' to "teste"

Don forget the semi-colon in the end of line

Quote:

SendClientMessageToAll(-1, "test");
Reply
#10

The full OnDialogResponse:
Click here

Only 1 dialog with response, yeah.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)