Posts: 218
Threads: 46
Joined: Feb 2018
Reputation:
0
How to use inputtext as pID?
Like that
if(dialogid == DIALOG_MDCCHECK)
{
new mdccheck[128];
new pid = strval(inputtext); // that doesnt / wouldnt work
format(mdccheck,sizeof(mdccheck),"Name:%s\nWanted: %d\nWanted Reason:%s",inputtext[pid],PlayerInfo[pid][pWanted],PlayerInfo[pid][pWantedReason]);
ShowPlayerDialog(playerid,105,DIALOG_STYLE_MSGBOX, "Data",mdccheck,"Exit","");
return 1;
}
Posts: 1,915
Threads: 64
Joined: Jan 2016
Reputation:
0
What doesn't works? You need to give more details and stuff like that instead of just "that doesn't works"
Posts: 357
Threads: 6
Joined: Feb 2018
What you are doing?
Inputtext is text which you put in the input dialog.
Код:
if(dialogid == DIALOG_MDCCHECK)
{
new mdccheck[128];
new Playername[24];
new pid = strval(inputtext);
if(pid == INVALID_PLAYER_ID)
return SendClientMessage(playerid, -1, "Player not connected!");
GetPlayerName(pid, Playername, sizeof(Playername));
format(mdccheck,sizeof(mdccheck),"Name:%s\nWanted: %d\nWanted Reason:%s", Playername ,PlayerInfo[pid][pWanted],PlayerInfo[pid][pWantedReason]);
ShowPlayerDialog(playerid,105,DIALOG_STYLE_MSGBOX, "Data" ,mdccheck,"Exit","");
return 1;
}
This code will check the wanted of online players using their id(playerid). You can use playerid instead of player name in input dialog(which executes DIALOG_MDCCHECK).
Posts: 357
Threads: 6
Joined: Feb 2018
Quote:
Originally Posted by playstores
Your code isnt working too, I just get the Name of the playerid
|
Well, can you explain what doesn't work? or provide the screenshot of the dialog 'DIALOG_MDCCHECK'(which shows the informations) of ingame.
Posts: 218
Threads: 46
Joined: Feb 2018
Reputation:
0
works perferctly with sccanf, thx mates,
sscanf never let me down :3
closed