12.03.2014, 12:56
pawn Код:
else if(dialogid == DIALOG_MDCPERSON)
{
printf("CALLED DIALOG_MDCPERSON");
if(response == 0)
{
ShowPlayerDialog(playerid, DIALOG_MDCMAIN, DIALOG_STYLE_LIST, "Mobile Data Computer", "Person Check\nVehicle Check\nBOLOS\nEmergency Calls\n", "Select", "Exit");
}
if(response == 1)
{
new escape[28], query[64];
mysql_real_escape_string(inputtext, escape);
format(query, sizeof(query), "SELECT `id` FROM `accounts` WHERE `PlayerName` = '%s' LIMIT 1", escape);
mysql_query(query);
mysql_store_result();
if(mysql_num_rows() > 0)
{
new string[256], second[64];
new id = mysql_fetch_int();
format(string, sizeof(string), "Full Name: {FF0000}%s\n", inputtext);
strcat(string, second);
HouseOwned[id] = MySQL_GetValue(id, "HouseOwned", "accounts");
if(HouseOwned[id] > 0)
{
format(second, sizeof(second), "Address: {FF0000}%s",HouseName[id]);
strcat(string, second);
}
if(HouseOwned[id] < 1)
{
format(second, sizeof(second), "Address: {FF0000}No Known Address.");
strcat(string, second);
}
Cellphone[id] = MySQL_GetValue(id, "Cellphone", "accounts");
Number[id] = MySQL_GetValue(id, "Number", "accounts");
if(Cellphone[id] > 0)
{
format(second, sizeof(second), "Contact Number: {FF0000}%d", Number[id]);
strcat(string, second);
}
if(Cellphone[id] < 1)
{
format(second, sizeof(second), "Contact Number: {FF0000}No Known Contact Number.", Number[id]);
strcat(string, second);
}
ShowPlayerDialog(playerid,DIALOG_SHOWPERSON,DIALOG_STYLE_MSGBOX,"Person Search Results", string,"Close","");
}
if(mysql_num_rows() < 1)
{
SendClientMessage(playerid, COLOUR_GREY, "Person Search Failed. Not Found.");
}
}
}

