Whats wrong here?
#1

Well I made a Dialog for OnPlayerRequestSpawn and when a player selects a certain skin the Dialog shows but it doesn't.

pawn Код:
if (dialogid == 20)
    {
        if(response)
        {
            new message[256+1];
            if(listitem == 0)
            {
            format(message, 256, "You have selected Los Santos Airport!", listitem);
            SendClientMessage(playerid, 0xFFFFFFFF, message);
            SetPlayerPos(playerid, 1895.2489,-2333.6741,13.5469);
            }
        }
    }
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if (gTeam[playerid] == TEAM_PILOT)
    {
        switch(GetPlayerTeam(GetPlayerSkin(playerid)))
        {
            case 17, 57, 61, 163, 164, 165, 166, 187:
            {
               ShowPlayerDialog(playerid, 20, DIALOG_STYLE_LIST, "Pilot's Spawn Point", "Los Santos Airport\nSan Fierro Airport\nLas Venturas Airport", "Select", "Cancel");
            }
        }
    }
    return 1;
}
Reply
#2

pawn Код:
switch(GetPlayerTeam(GetPlayerSkin(playerid)))
Why you have GetPlayerTeam in there?
Reply
#3

So it finds the player team , Or is it wrong?
Reply
#4

This does not relate to your problem, however it does address a serious flaw in your coding.

pawn Код:
if (dialogid == 20)
    {
        if(response)
        {
            new message[256+1];
            if(listitem == 0)
            {
            format(message, 256, "You have selected Los Santos Airport!", listitem);
            SendClientMessage(playerid, 0xFFFFFFFF, message);
            SetPlayerPos(playerid, 1895.2489,-2333.6741,13.5469);
            }
        }
    }
Why have you created a string with the size of 257. You do not even use format to properly add any strings. You can simply add a client message without any formatting. Even so, the limit for chat messages is 128, not 256, not 257, the limit is 128.

https://sampforum.blast.hk/showthread.php?tid=55261
Reply
#5

Quote:
Originally Posted by -Luis
Посмотреть сообщение
So it finds the player team , Or is it wrong?
I think it is wrong.

If you want to show the dialog for a certain skin, then just

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    switch(GetPlayerSkin(playerid))
    {
        case 17, 57, 61, 163, 164, 165, 166, 187:
        {
            ShowPlayerDialog(playerid, 20, DIALOG_STYLE_LIST, "Pilot's Spawn Point", "Los Santos Airport\nSan Fierro Airport\nLas Venturas Airport", "Select", "Cancel");
        }
    }
    return 1;
}
Reply
#6

Thanks, It worked!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)