16.08.2014, 06:50
(
Последний раз редактировалось RedCounty; 17.08.2014 в 14:26.
)
Delete
command(getwarnings, playerid, params[])
{
new Query[100];
// get the player name
mysql_format(connectionhandle, Query,sizeof(Query),"SELECT * FROM `warnings` WHERE `Name` = '%s'", name); // Change to your connectionhandle and the table name and field
mysql_tquery(connectionhandle, Query, true, "DisplayWarnings", "ds", playerid, name);
return 1;
}
forward DisplayWarnings(playerid, playername[]);
public DisplayWarnings(playerid, playername[])
{
new rows, fields;
cache_get_data(rows, fields, cHandle);
if(rows)
{
for(new i = 0; i< rows; i++)
{
new chandle[500], reason[128], admin[25], string[500]; // Change the values, they are just random
cache_get_field_content(i, "Reason", chandle, connectionhandle);
format(reason,sizeof(reason),"%s",chandle);
cache_get_field_content(i, "Admin", chandle, connectionhandle);
format(admin,sizeof(reason),"%s",chandle);
format(string,sizeof(string),"%s\nName: %s Reason: %s Admin: %s",string, playername, reason, admin);
ShowPlayerDialog(playerid, YOUR_DIALOG_ID, DIALOG_STYLE_MSGBOX, "Warnings", string,"Okay","");
}
else return SendClientMessage(playerid, -1, "There are no warnings to be shown.");
return 1;
}