Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:apanel(playerid, params[])
- {
- //daj, zabierz
- //sprawdzanie czy admin ma jakis tam admin lvl
- new comm1[32], comm2[256];
- if(sscanf(params, "s[32]S()[128]", comm1, comm2))
- {
- ShowPlayerDialog(playerid, 9999, DIALOG_STYLE_MSGBOX, " Zastosowanie komendy", "Użyj: /apanel daj/zabierz/info", "Zamknij", "");
- return 1;
- }
- else
- {
- if(!strcmp(comm1, "daj", true))
- {
- new playerid2, idfrakcji, string[256];
- if(sscanf(comm2, "id", playerid2, idfrakcji))
- {
- ShowPlayerDialog(playerid, 9999, DIALOG_STYLE_MSGBOX, " Zastosowanie komendy", "Użyj: /apanel daj [playerid] [frakcjaid]", "Zamknij", "");
- return 1;
- }
- else
- {
- if (!IsPlayerConnected(playerid2))
- return SendClientMessage(playerid, -1, "Gracz nie jest zalogowany.");
- if(idfrakcji < 1 || idfrakcji > 6)
- {
- format(string, sizeof(string), "ID frakcji nie moze byc mniejsze od 1 i wieksze od 6.", PlayerName(playerid2), idfrakcji);
- ShowPlayerDialog(playerid, 9999, DIALOG_STYLE_MSGBOX, " Informacje", string, "Zamknij", "");
- }
- else
- {
- DodajFrakcjetestowe(playerid2, idfrakcji);
- format(string, sizeof(string), "Frakcja gracza %s zostala zmieniony na %d.", PlayerName(playerid2), idfrakcji);
- ShowPlayerDialog(playerid, 9999, DIALOG_STYLE_MSGBOX, " Informacje", string, "Zamknij", "");
- format(string, sizeof(string), "Administrator %s (ID: %d) ustalil cie liderem frakcji id %d.", PlayerName(playerid), playerid, idfrakcji);
- ShowPlayerDialog(playerid2, 9999, DIALOG_STYLE_MSGBOX, " Informacje", string, "Zamknij", "");
- return 1;
- }
- }
- }
- if(!strcmp(comm1, "zabierz", true))
- {
- new playerid2, string[256];
- if(isnull(comm2))
- {
- ShowPlayerDialog(playerid, 9999, DIALOG_STYLE_MSGBOX, " Zastosowanie komendy", "Użyj: /apanel zabierz [playerid]", "Zamknij", "");
- return 1;
- }
- else
- {
- if (!IsPlayerConnected(playerid2))
- return SendClientMessage(playerid, -1, "Gracz nie jest zalogowany.");
- ZabierzFrakcjetestowe(playerid2);
- format(string, sizeof(string), "Frakcja gracza %s zostala zabrana.", PlayerName(playerid2));
- ShowPlayerDialog(playerid, 9999, DIALOG_STYLE_MSGBOX, " Informacje", string, "Zamknij", "");
- format(string, sizeof(string), "Administrator %s (ID: %d) zabral ci funkcje lidera.", PlayerName(playerid), playerid);
- ShowPlayerDialog(playerid2, 9999, DIALOG_STYLE_MSGBOX, " Informacje", string, "Zamknij", "");
- return 1;
- }
- }
- }
- if(!strcmp(comm1, "info", true))
- {
- new idfrakcji, string[256];
- if(isnull(idfrakcji))
- {
- ShowPlayerDialog(playerid, 9999, DIALOG_STYLE_MSGBOX, " Zastosowanie komendy", "Użyj: /apanel info [frakcjaid]", "Zamknij", "");
- return 1;
- }
- else
- {
- new Query2[256];
- format(Query2, sizeof(Query2), "SELECT `uid`,`username`,`frakcja_id`,`frakcja_lider` FROM `mybb_users` WHERE `frakcja_id`='%d' AND `frakcja_lider`='1';", idfrakcji);
- mysql_query(Query2);
- mysql_store_result();
- if(mysql_num_rows()) {
- mysql_fetch_row(Query2);
- sscanf(Query2,"p<|>dsdd",
- Frakcja[fUID],
- Frakcja[fName],
- Frakcja[fID],
- Frakcja[fFrakcja_LIDER]
- );
- mysql_free_result();
- format(string, sizeof(string), "Liderem frakcji ID: %d jest osoba o UID: %d, NICK: %s", idfrakcji, Frakcja[fUID], Frakcja[fName]);
- ShowPlayerDialog(playerid, 9999, DIALOG_STYLE_MSGBOX, "Sprawdzanie frakcji", string, "Zamknij", "");
- } else {
- mysql_free_result();
- format(string, sizeof(string), "Nikt nie jest liderem frakcji o ID: %d", idfrakcji);
- return ShowPlayerDialog(playerid, 9999, DIALOG_STYLE_MSGBOX, "Sprawdzanie frakcji", string, "Zamknij", "");
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement