Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // SETADMIN
- Dcmd_setadmin (playerid, params [])
- {
- #pragma unused params
- If (! IsPlayerAdmin (playerid) && Player [playerid] [pAdministrator] <7)
- Return SendClientMessage (playerid, COR_ERRO, "[ERROR] {FFFFFF} You are not allowed to use this command!");
- New tmp [256], Index;
- Tmp = strtok (params, Index);
- New id;
- New tmp2 [256]; Tmp2 = strtok (params, Index);
- // GetPlayerName (playerid, Nyme, sizeof (Nyme));
- If (! Strlen (tmp) ||! Strlen (tmp2) ||! IsNumeric (tmp2) ||! (Strval (tmp2)> = 0 && strval (tmp2) <= 7))
- Return SendClientMessage (playerid, COR_BRANCO, "Usage: / setadmin [id or nick] [level]");
- If (! IsNumeric (tmp))
- Id = ReturnPlayerID (tmp);
- Else
- Id = strval (tmp)
- If (! IsPlayerConnected (id))
- {
- New file [255];
- Format (file, 256, "GM / Players /% s.ini", tmp);
- If (dini_Exists (file))
- {
- Dini_IntSet (file, "Administrator", strval (tmp2));
- New string [128];
- Format (string, sizeof (string), "AdminCMD: You set the account level from% s to% d", tmp, strval (tmp2));
- SendClientMessage (playerid, COR_PRINCIPAL, string);
- (AccountID (playerid), Nyme [playerid], tmp, strval (tmp2)); "% s% s has changed the account level from% s to% d.
- SendMessageToAdminsEx (string);
- Format (string, sizeof (string), "% s set at% d level of admin.", Nyme [playerid], tmp, strval (tmp2));
- Return 1;
- }
- Else
- Return SendClientMessage (playerid, COR_ERRO, "Player not found!");
- }
- Else
- {
- If (pAddress [id] == false)
- Return SendClientMessage (playerid, COR_ERRO, "The selected player is not logged in.");
- New string [128];
- Player [id] [pAdministrator] = strval (tmp2);
- (AccountName (playerid), Nyme [id], strval (tmp2), AccountName (id));
- SendClientMessage (id, COR_PRINCIPAL, string);
- You have changed the account level from% s (id:% d) to% d -% s ", Nyme [id], id, strval (tmp2), AccountName (id)).
- SendClientMessage (playerid, COR_PRINCIPAL, string);
- % S -% s ", AccountName (playerid), Nyme [playerid], Nyme [id], strval (tmp2) , AccountName (id));
- SendMessageToAdminsEx (string);
- Format (string, sizeof (string), "% s set at% admin level."), Nyme [playerid], Nyme [id], strval (tmp2));
- SavePlayer (id);
- }
- Return 1;
- }
- /// ADMINS
- Dcmd_ADMINS (playerid, params [])
- {
- #pragma unused params
- If (playerList [playerid] == false) return SendClientMessage (playerid, COR_ERRO, "ERROR: You are not logged in!");
- // when declaring the string:
- New szDialog [150] = "Name \ tStatus \ n";
- // change "150" to the size you use
- New File [40], name [MAX_PLAYER_NAME];
- GetPlayerName (playerid, name, sizeof (name));
- Format (szDialog, sizeof (szDialog), "% s% s \ t% s {FFFFFF} \ n",
- SzDialog, CONTASADM, (playerid! = INVALID_PLAYER_ID)? ("{04BD04} Connected"): ("{D10F0F} Disconnected"));
- ShowPlayerDialog (playerid, 9919, DIALOG_STYLE_TABLIST_HEADERS, "{FF0000} List of all DJ's", szDialog, "Select", "Back");
- Return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement