jlalt

zzwq

Jun 3rd, 2016
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.19 KB | None | 0 0
  1. CMD:suggestions(playerid, params[])
  2. {
  3.     if(PlayerInfo[playerid][Level] >= 6)
  4.     {
  5.         new Query[256],string[145],Handle[2500],spn[MAX_PLAYER_NAME];
  6.         format(Query, sizeof(Query), "SELECT * FROM 'SUGGESTIONS'");
  7.         new DBResult:Result = db_query(bans, Query);
  8.         if(db_num_rows(Result)) {
  9.            for(new i = 0; i < db_num_rows(Result); i++) {
  10.               new suggestion[250], SDate[MAX_PLAYER_NAME], day, month, year;
  11.               GetPlayerName(playerid, spn, sizeof(spn));
  12.               db_get_field_assoc(Result, "PLAYER", spn, sizeof(spn));
  13.               db_get_field_assoc(Result, "DATE", SDate, sizeof(SDate));
  14.               db_get_field_assoc(Result,"SUGGESTION", suggestion, sizeof (suggestion));
  15.               format(string, sizeof(string), "%s - %s by %s\n",suggestion,SDate,spn);
  16.               strcat(Handle, string);
  17.               db_next_row(Result);
  18.            }
  19.            ShowPlayerDialog( playerid, 0, DIALOG_STYLE_MSGBOX, "Suggestions List", Handle, "Close", "" );
  20.            SendCommandToAdmins(playerid, "Suggestions");
  21.         } else SendClientMessage(playerid, -1,"NO Suggestion FOund On DB!");
  22.         db_free_result(Result);
  23.     } else return SendClientMessage(playerid,0xFF0000AA,"ERROR: You must be level 6 to use this commands");
  24. }
Advertisement
Add Comment
Please, Sign In to add comment