SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 11/08/2013, 09:51 PM   #1
ThaCrypte
Huge Clucker
 
Join Date: May 2012
Location: On the internet.
Posts: 232
Reputation: 11
Default Makeadmin

So, i've been scripting my /makeadmin cmds, and other cmds, but i know i am missing a line or two.
Currently everything works, so if you do /makeadmin Dobby 8, his admin level will be set to 8. but once i do /makeadmin, without anything behind, it sets dobby's adminlevel to 0.

CMD:
pawn Code:
CMD:makeadmin(playerid, params[])
{
            new admin, playerb;
            if(PlayerInfo[playerid][pAdmin] < 8) return SendClientMessage(playerid, COLOR_REDD, "[ERROR] You do not have the right's to use this command!");
            if(sscanf(params, "ui", playerb, admin)) SendClientMessage(playerid, COLOR_LGREEN, "Usage: /makeadmin [playerid/partname] [level]");
            {
              PlayerInfo[playerb][pAdmin] = admin;
              SendClientMessage(playerb, -1, "Your admin level has been changed!"); // i know these 2 lines look's gay, but i cba to change them xD
              SendClientMessage(playerid, -1, "You changed their admin level!");
              return 1;
            }
}
ThaCrypte is offline   Reply With Quote
Old 11/08/2013, 09:54 PM   #2
EmpireSk
Huge Clucker
 
EmpireSk's Avatar
 
Join Date: Jul 2013
Location: Slovakia
Posts: 356
Reputation: 10
Default Re: Makeadmin

Did you do through the RCON
__________________
EmpireSk is offline   Reply With Quote
Old 11/08/2013, 09:58 PM   #3
ThaCrypte
Huge Clucker
 
Join Date: May 2012
Location: On the internet.
Posts: 232
Reputation: 11
Default Re: Makeadmin

nope, and i see the error already, i forgot to place a return @
pawn Code:
if(sscanf(params, "ui", playerb, admin)) SendClientMessage(playerid, COLOR_LGREEN, "Usage: /makeadmin [playerid/partname] [level]");
It should be:
pawn Code:
if(sscanf(params, "ui", playerb, admin)) return SendClientMessage(playerid, COLOR_LGREEN, "Usage: /makeadmin [playerid/partname] [level]");
Thanks anyways :P
ThaCrypte is offline   Reply With Quote
Old 11/08/2013, 10:10 PM   #4
EmpireSk
Huge Clucker
 
EmpireSk's Avatar
 
Join Date: Jul 2013
Location: Slovakia
Posts: 356
Reputation: 10
Default Re: Makeadmin

if(sscanf(params, "ui", playerb, admin)) return SendClientMessage(playerid, COLOR_LGREEN, "Usage: /makeadmin [playerid/partname] [level]");
__________________
EmpireSk is offline   Reply With Quote
Old 11/08/2013, 10:29 PM   #5
RedJohn
Gangsta
 
RedJohn's Avatar
 
Join Date: Jul 2012
Posts: 565
Reputation: 60
Default Re: Makeadmin

pawn Code:
CMD:makeadmin(playerid, params[])
{
    new admin, playerb;
    if(PlayerInfo[playerid][pAdmin] < 8) return SendClientMessage(playerid, COLOR_REDD, "[ERROR] You do not have the right's to use this command!");
    if(sscanf(params, "ui", playerb, admin)) return SendClientMessage(playerid, COLOR_LGREEN, "Usage: /makeadmin [playerid/partname] [level]");
    SendClientMessage(playerb, -1, "Your admin level has been changed!");
    SendClientMessage(playerid, -1, "You changed their admin level!");
    PlayerInfo[playerb][pAdmin] = admin;
    return 1;
}
RedJohn is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
/makeadmin GAMER_PS2 Scripting Help 4 25/05/2013 04:30 PM
[HELP] Makeadmin xMichaelx Scripting Help 6 09/12/2011 09:48 AM
/makeadmin help Christian_Bojic Help Archive 7 24/07/2011 09:15 PM
need help with /makeadmin cmd PheonixButcher Help Archive 10 25/04/2011 03:38 PM


All times are GMT. The time now is 01:39 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.