19.05.2017, 20:04
Quote:
Код:
OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) So you should do something like this.Instead of Код:
new criminal = inputtext; Код:
if(sscanf(inputtext, "u", criminal)) return SendClientMessage(playerid, COLOR, "Invalid player."); |
PHP код:
if(dialogid == DIALOG_POLICE_NAMESEARCH)
{
if(!response)
{
ShowPlayerDialog(playerid, DIALOG_POLICE_MDC, DIALOG_STYLE_LIST, " ____[MDC - Mobile Data Computer]___", "{FFFFFF}Name Search\n{FFFFFF}Plate Search\n{FFFFFF}BOLOs\n", "Select", "Cancel");
}
if(response)
{
new string[128];
new criminal;
new Float:X, Float:Y, Float:Z;
GetPlayerPos(criminal, X, Y, Z);
if(sscanf(inputtext, "u", criminal))
{
format(string, sizeof(string),"_______________________________[MDC - Mobile Data Computer]_______________________________");
SCM(playerid, COLOR_WHITE, string);
format(string, sizeof(string),"Full Name: "COL_WHITE"%s", GetName(criminal));
SCM(playerid, COLOR_SJPD, string);
format(string, sizeof(string),"Full Name: "COL_WHITE"%s", PlayerInfo[criminal][pName]);
SCM(playerid, COLOR_SJPD, string);
return 1;
}
}
}
PHP код:
if(dialogid == DIALOG_POLICE_PLATESEARCH)
{
if(!response)
{
ShowPlayerDialog(playerid, DIALOG_POLICE_MDC, DIALOG_STYLE_LIST, "[MDC - Mobile Data Computer]", "{FFFFFF}Name Search\n{FFFFFF}Plate Search\n{FFFFFF}BOLOs\n", "Select", "Cancel");
}
if(response)
{
new string[128];
new plate;
if(sscanf(inputtext, "d", plate))
{
foreach(Player,i)
{
if(plate == PlayerInfo[i][pPlate1] || plate == PlayerInfo[i][pPlate2] || plate == PlayerInfo[i][pPlate3])
{
format(string, sizeof(string),"_______________________________[%d]_______________________________", plate);
SCM(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "[Vehicle Owner:] "COL_WHITE"%s.", PlayerInfo[i][pName]);
SCM(playerid, COLOR_SJPD, string);
} else return SCM(playerid, COLOR_LIGHTRED, "There is no player with that license plate.");
}
return 1;
}
}
}