Dialog help
#1

Is there anyway to Extract playerid from the inputtext like
pawn Код:
new preport[128];
        format(preport, sizeof(preport), "[PRIVATE-REPORT]%s would like to talk to you", GetPlayerNameEx(playerid));
        SendClientMessage(inputtext, COLOR_REPORT, string);
this message will be sent to the admin name he placed in the dialog input
Reply
#2

A better way would be to use OnPlayerClickPlayer.
Then you could do:
pawn Код:
public OnPlayerClickPlayer(playerid, clickedid, source)
{
     // Whatever ifs you used to check if player is ALLOWED TO click, example
     if( is_player_allowed_to_choose_an_admin_to_talk_to[ playerid ] == 1 )
     {
           if( PlayerEnum[ clickedid ][ admin_var ] > 0 )
           {
                // Do all that sending of messages
            }
     }
 return 1;
}
This is way much better, suggesting.
Reply
#3

No,this isn't the idea,the idea is i made a report menu,and it has Select a private admin to talk to,and you type in the name in a dialog_input, here's the full code

pawn Код:
if(dialogid == REPORT_TALK)
    {
        new preport[128];
        format(preport, sizeof(preport), "[PRIVATE-REPORT]%s would like to talk to you", GetPlayerNameEx(playerid));
        SendClientMessage(inputtext, COLOR_REPORT, string);
    }
Reply
#4

I suggested what I did, because, you can never guess what the player is going to enter. An admin's name may be "H[o]" but he might enter "Talk to h[o]" or "HO" which basically would return him an error. But anyways, you can use:
pawn Код:
if(dialogid == REPORT_TALK)
    {  new name[24];
        foreach( new i:Player )
        {  GetPlayerName(i, name, 24);
            if(strcmp(inputtext, name, true) == 0)
            {
                  new preport[128];
                  format(preport, sizeof(preport), "[PRIVATE-REPORT]%s would like to talk to you",         GetPlayerNameEx(playerid));
                  SendClientMessage(i, -1, preport);
             }
        ..........
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)