SA-MP Forums Archive
Wrong code in ladmin :( - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Wrong code in ladmin :( (/showthread.php?tid=443744)



Wrong code in ladmin :( - MarioVPS - 13.06.2013

Hi guys,

look i scripted this in my ladmin:



pawn Код:
CMD:applyforadmin(playerid,params[])
{
            new NeededScoreAdmin;
            new CheckPlayerLevel;
            new AcceptPlayerForAdmin;
            AcceptPlayerForAdmin = playerid;
            NeededScoreAdmin = 30000;
            CheckPlayerLevel = playerid;
            if(GetPlayerScore(playerid) < NeededScoreAdmin)
            SetPlayerScore(CheckPlayerLevel, -10);
            dUserSetINT(PlayerName2(playerid)).("level",(1));
            SendClientMessage(AcceptPlayerForAdmin,red,"Accepted As Tester (Level 1), Congratz %s");
            return 1;
}
I created this to apply for admin from game, when u haves 30000 score and u typ /applyforadmin its applying for admin and accepting u as lvl 1 admin

But theres a problem When a player types the cmd it sets the level to 1 without having the needed score

Help please, thanks


Re: Wrong code in ladmin :( - ReVo_ - 13.06.2013

Код:
CMD:applyforadmin(playerid,params[])
{
            new NeededScoreAdmin;
            new CheckPlayerLevel;
            new AcceptPlayerForAdmin;
            AcceptPlayerForAdmin = playerid;
            NeededScoreAdmin = 30000;
            CheckPlayerLevel = playerid;
            if(GetPlayerScore(playerid) >= NeededScoreAdmin) {
            
            SetPlayerScore(CheckPlayerLevel, -10);
            dUserSetINT(PlayerName2(playerid)).("level",(1));
            SendClientMessage(AcceptPlayerForAdmin,red,"Accepted As Tester (Level 1), Congratz %s");
}
else {
SendClientMessage(playerid, -1, "you dont have points");
}
            return 1;
}



Re: Wrong code in ladmin :( - MarioVPS - 13.06.2013

Thanks it worked Revo


Re: Wrong code in ladmin :( - MarioVPS - 13.06.2013

Sry another help when i typ the command its makes the server offline


Re: Wrong code in ladmin :( - Anak - 13.06.2013

which command? same?


Re: Wrong code in ladmin :( - MarioVPS - 13.06.2013

Quote:
Originally Posted by Anak
Посмотреть сообщение
which command? same?
Yes CMD:applyforadmin when i typs it its makes the server go offline