20.06.2012, 13:01
Hi there. I'm making an MDC system, but for some weird reason whenever I type in a name of the player, the results dialog won't show up. But if I type in a name of the player that's not connected or I type in something random, the dialog that tells me that there's no results shows up fine.
Can anyone help me out?
Can anyone help me out?
pawn Код:
if(dialogid == 54)
{
if(!response) return ShowPlayerDialog(playerid,53,DIALOG_STYLE_LIST, "San Andreas State Police - Mobile Database Center", "Search Name\nRun Number Plates\nTrace Cellphone\nView Wanted\nIssue APB\nCancel APB\nRequest Backup", "Select", "Cancel");
if(strlen(inputtext) < 1 || strlen(inputtext) > MAX_PLAYER_NAME) return ShowPlayerDialog(playerid, 54, DIALOG_STYLE_INPUT, "MDC - {FF0000}No Results", "Please enter a name:", "Search", "Back");
new user;
user = ReturnUser(inputtext);
if(!IsPlayerConnected(user)) return ShowPlayerDialog(playerid, 54, DIALOG_STYLE_INPUT, "MDC - {FF0000}No Results", "Please enter a name:", "Search", "Back");
new i = user;
new string[1024], name[MAX_PLAYER_NAME], surname[2][50];
GetPlayerName(playerid, name, sizeof(name));
split(name, surname, '_');
new houselocation[MAX_ZONE_NAME];
GetCoords2DZone(Houses[PlayerInfo[i][pHouseKey]][EnterX],Houses[PlayerInfo[i][pHouseKey]][EnterY], houselocation, MAX_ZONE_NAME);
new address[100], baddress[100];
if(PlayerInfo[i][pHouseKey] != 255)
{
format(address, 100, "%d %s", PlayerInfo[i][pHouseKey], houselocation);
}
else
{
format(address, 100, "None");
}
if(PlayerInfo[i][pBizKey] != 255)
{
format(baddress, 100, "%s", Businesses[PlayerInfo[i][pBizKey]][BusinessName]);
}
else
{
format(baddress, 100, "None");
}
new cname[3][70];
if(PlayerInfo[playerid][pVeh1Model] != -1)
{
format(cname[0], 70, "%s", VehicleNames[PlayerInfo[i][pVeh1Model]-400]);
}
else format(cname[0], 70, "None");
if(PlayerInfo[playerid][pVeh2Model] != -1)
{
format(cname[1], 70, "%s", VehicleNames[PlayerInfo[i][pVeh2Model]-400]);
}
else format(cname[1], 70, "None");
if(PlayerInfo[playerid][pVeh3Model] != -1)
{
format(cname[2], 70, "%s", VehicleNames[PlayerInfo[i][pVeh3Model]-400]);
}
else format(cname[2], 70, "None");
format(string, sizeof(string), "First name: %s\nLast name: %s\nAddress: %s\nCellphone: %i\nBusiness: %s\nModel: %s\nPlate: %s\nModel: %s\nPlate: %s\nModel: %s\nPlate: %s\n\n", surname[0], surname[1], address, PlayerInfo[playerid][pPhoneNumber], baddress, cname[0], PlayerInfo[i][pVeh1License], cname[1], PlayerInfo[i][pVeh2License], cname[2], PlayerInfo[i][pVeh3License]);
if(PlayerInfo[i][pWanted] == 1)
{
format(string, sizeof(string), "%sStatus: {FF0000}WANTED\n{A9C4E4}Wanted For: {FF0000}%s",string, PlayerInfo[i][pWantedFor]);
}
else
{
format(string, sizeof(string), "%sStatus: {00FF00}NOT WANTED\n{A9C4E4}Wanted For: {00FF00}None", string);
}
ShowPlayerDialog(playerid, 59, DIALOG_STYLE_LIST, "MDC Result", string, "Back", "Close");
return 1;
}

