14.12.2012, 21:32
pawn Код:
if(dInfo[playerid][dVar1] == 0)
{
new pID = GetPlayerID(inputtext);
if(IsPlayerConnected(pID)) // Not working as its suppose to
{
new suspected[4];
new house = GetUserHouse(pID);
if(pInfo[pID][pWanteds] >= 1) { suspected="Yes"; } else { suspected="No"; }
new string[64];
format(string, sizeof(string), "Persons Name: %s\nSuspected: %d\nHouse: %d\n", inputtext, suspected, house);
ShowPlayerDialog(playerid, GUI_MDC, DIALOG_STYLE_MSGBOX, "MDC - Person Information", string, "Ok", "");
}
else {
new query[300];
format(query, sizeof(query), "SELECT * FROM %splayers WHERE name = '%s'", SQL_PREFIX, inputtext);
mysql_query(query);
new rows = strval(query);
if(rows == 1)
{
format(query, sizeof(query), "SELECT Wanteds FROM %splayers WHERE name = '%s'", SQL_PREFIX, inputtext);
mysql_query(query);
new wanteds = strval(query);
new string[64];
format(string, sizeof(string), "Persons Name: %s\nSuspected: %d", inputtext, wanteds);
ShowPlayerDialog(playerid, GUI_MDC, DIALOG_STYLE_MSGBOX, "MDC - Person Information", string, "Ok", "");
}
else {
ShowInfoDialog(playerid, "MDC - Error", "This name does not exist in the police database.");
}
}
}
ShowInfoDialog(playerid, "MDC - Error", "This name does not exist in the police database.");