SA-MP Forums Archive
[HELP] Player Status Is DIALOG_STYLE_MSGBOX - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Player Status Is DIALOG_STYLE_MSGBOX (/showthread.php?tid=212746)



[HELP] Player Status Is DIALOG_STYLE_MSGBOX - Larsey123IsMe - 17.01.2011

Title sais everything

pawn Код:
if(listitem == 1) // Player Info
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
               
    new IP[16];
    GetPlayerIp(playerid, IP, sizeof(IP));

    ShowPlayerDialog(playerid, STATUS_DIALOGID+1, DIALOG_STYLE_MSGBOX, "Player Info", "Name: %s \nIP: %d", "OK", "Cancel", name, IP); // I tried buy failed, like i did over and over and over again...
}



Re: [HELP] Player Status Is DIALOG_STYLE_MSGBOX - Alex_Valde - 17.01.2011

You need to format it first.
Something like this:
pawn Код:
new str[128];
format(str, sizeof(str), "Name: %s \nIP: %d",name, IP);
ShowPlayerDialog(playerid, STATUS_DIALOGID+1, DIALOG_STYLE_MSGBOX, "Player Info",str, "OK", "Cancel");
Haven't tested it.


Re: [HELP] Player Status Is DIALOG_STYLE_MSGBOX - zSuYaNw - 17.01.2011

Yeah!
pawn Код:
if(listitem == 1) // Player Info
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
               
    new IP[16];
    GetPlayerIp(playerid, IP, sizeof(IP));
    new string[100];
    format(string, sizeof(string),"Name: %s \nIP: %d", name, IP);
    ShowPlayerDialog(playerid, STATUS_DIALOGID+1, DIALOG_STYLE_MSGBOX, "Player Info", string , "OK", "Cancel"); // I tried buy failed, like i did over and over and over again...
}



Re: [HELP] Player Status Is DIALOG_STYLE_MSGBOX - Larsey123IsMe - 17.01.2011

Thx, Problem Solved