Admin system ?
#1

Hi,


Pastbin: http://pastebin.com/sFjfx02X


I found on the forum cmd to make an player admin. So I tried to use this cmd for my "GM" but when I use this command in game, nothing happen except "SERVEUR: Unknown command."


Could you please help me for this ?
Reply
#2

Forget about that code, its outdated
Also don't copy code from somewhere use finished scripts and include / load them
Or just create your own admin system (that not just one command)
Reply
#3

Thank you, but I dont understand tutorials about cmds, what type of cmds should I use ?

Have you a "recent" tutorial ?

For exemple, zcmd tutorial: 2009


PS: I got all includes for the code I used, I got no error, no warnings when I compile. But can't use this cmd IG.
Reply
#4

Choose any zcmd tutorial here http://forum.sa-mp.com/search.php?searchid=7644457
If that is what you wanted, there is ycmd as well but I really don't know that one. ^^
Reply
#5

Thank you guy !

I will read those tutorials


Could you please explain me what's the difference between zcmd/sscanf and others

And what should I use ? zcmd?sscanf? other ?
Reply
#6

You said you use zcmd, OnPlayerCommandText is incompatible with it
Well you can't know that, he should at least added support for it

If you are already using zcmd I expect that you use sscanf as well
pawn Код:
CMD:mettreadmin(playerid, params[]) {
    new
        para1,
        level
    ;
    if(sscanf(params, "ui", para1, level)) {
        return SendClientMessage(playerid, -1, "Utilisation: /mettreadmin [IdJoueur/NomPrйnom] [niveau(10-90)]");
    }
    if(pInfo[playerid][Admin] < 90) {
        return SendClientMessage(playerid, -1, "Cette commande n'est pas disponible !");
    }
    if(pInfo[playerid][Admin] <= level) {
        return SendClientMessage(playerid, -1, "Vous n'avez pas le niveau admin requis pour effectuй cette commande !");
    }
    if(!IsPlayerConnected(para1)) {
        return SendClientMessage(playerid,-1,"La commande entrйe est inconnue !");
    }
    GetPlayerName(para1, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    pInfo[para1][Admin] = level;
    printf("%s а mis %s admin niveau %d.", sendername, giveplayer, level);
    format(string, sizeof(string), "Vous avez йtй mis admin niveau  %d  par %s ! Utilisez /acmds pour voir vos commandes.", level, sendername);
    SendClientMessage(para1, -1, string);
    format(string, sizeof(string), "Vous avez mis %s au niveau Admin %d.", giveplayer,level);
    return SendClientMessage(playerid, -1, string);
}
Thats the same command just a little bit more readable
Reply
#7

Thank you guy, it works
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)