SA-MP Forums Archive
/setlevel problem - 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: /setlevel problem (/showthread.php?tid=438706)



/setlevel problem - burnfire - 21.05.2013

Hello SA:MP!I have another problem...I start to use BUD(Blasing User Databse) as result,I start an Admin Script!
And I have a problem with commands witch need to make changes in Database...
CODE is under...
P.S:Ignore the Romanian text,I need only to fix this code :
PHP код:
CMD:setlevel(playerid,params[])
{
    new 
givedplayerid,level,s0[128];
    new 
iUID BUD::GetNameUID(GetName(givedplayerid));
    if(
sscanf(params,"id",givedplayerid,level)) return SendClientMessage(playerid,0xFF0000FF,"Utilizare comanda:/setlevel <Playerid> <Level>");
    if(
level || level 10) return SendClientMessage(playerid,0xFF0000FF,"Level invalid!Te rugam sa alegi un level cuprins intre 0 si 50!");
    if(!
IsPlayerConnected(givedplayerid)) return SendClientMessage(playerid,0xFF0000FF,"Acest jucator nu este conectat!");
    if(
PInfo[playerid][Admin] < & !IsPlayerAdmin(playerid))
    {
    
SendClientMessage(playerid,0xFF0000FF,"Ai un level prea mic pentru a utiliza aceasta comanda!");
    }
    
PlayerPlaySound(playerid,1057,0,0,0);
    
PlayerPlaySound(givedplayerid,1057,0,0,0);
    
PInfo[givedplayerid][Admin] = level;
    
BUD::SetIntEntry(iUID,"Admin",level);
    
format(s0,sizeof(s0),"{FF0000}Royal {FF8800}Stunt {00FF00}Gaming {FFFFFF}AdmCmd:Admin %s[ID:%d] a setat levelul playerului %s[ID:%d] la %d!",GetName(playerid),playerid,GetName(givedplayerid),givedplayerid,level);
    
SendClientMessage(playerid,-1,"{FF0000}Royal {FF8800}Stunt {00FF00}Gaming {FFFFFF}AdmCmd:Comanda a fost executata cu succes!");
    return 
1;

Now let explain the problem:In game,and on /stats command,appear I have level 5!But,when I look in DB,appear I have level 10(10 because I put him from DB),but,In Game,doesn't work!Please help me!
Thanks


Re: /setlevel problem - Avi Raj - 21.05.2013

Its all right.
Thats your Stats problem.
Show that.


Re: /setlevel problem - burnfire - 21.05.2013

That's the /stats command:
PHP код:
CMD:stats(playerid,params[])
{
    new 
givedplayerid;
    if(
sscanf(params,"i",givedplayerid)) return SendClientMessage(playerid,0xFF0000FF,"Utilizare comanda:/stats <Playerid>");
    if(!
IsPlayerConnected(givedplayerid)) return SendClientMessage(playerid,0xFF0000FF,"Eroare:Acest player nu este conectat!");
    
format(result,sizeof(result),"*Nume : %s \n*Admin : %d \n*VIP : %d \n*Cash : %d \n*Score : %d \n*Muted : %d \n*Warns : %d",GetName(givedplayerid),PInfo[givedplayerid][Admin],PInfo[givedplayerid][VIP],PInfo[givedplayerid][Cash],PInfo[givedplayerid][Score],PInfo[givedplayerid][Muted],PInfo[playerid][Warns]);
    
ShowPlayerDialog(playerid,Stats,DIALOG_STYLE_MSGBOX,"Stats",result,"Ok","");
    return 
1;

And that is the /mystats command:
PHP код:
CMD:mystats(playerid)
{
    
format(result,sizeof(result),"*Nume : %s \n*Admin : %d \n*VIP : %d \n*Cash : %d \n*Score : %d \n*Muted : %d \n*Warns : %d",GetName(playerid),PInfo[playerid][Admin],PInfo[playerid][VIP],PInfo[playerid][Cash],PInfo[playerid][Score],PInfo[playerid][Muted],PInfo[playerid][Warns]);
    
ShowPlayerDialog(playerid,Mystats,DIALOG_STYLE_MSGBOX,"Statisticile mele",result,"Ok","");
    return 
1;

I need yours help
P.S:tx for /setlevel


Re: /setlevel problem - Avi Raj - 21.05.2013

hmm, Thats also Ok.
dude, Do these for a test :-
*Create a New account.
*Register.
*open scriptfiles > see that .ini (What admin level it have ?)
*Rcon login in-game.
*/setlevel to 10
*open scriptfiles folder again and see again.
*if its ok, relog with that account.
*do /mystats and tell if its ok or not.


Re: /setlevel problem - burnfire - 21.05.2013

1.I don't have .ini files
2.I will come with an edit
EDIT:It doesn't work (


Re: /setlevel problem - Snapptime - 21.05.2013

If you don't have .ini files, go download it.

Good luck


Re: /setlevel problem - burnfire - 21.05.2013

I don't understand...I have BUD::...It use SQL...HOW TO HAVE INI FILES


Re: /setlevel problem - burnfire - 22.05.2013

bump...


Re: /setlevel problem - burnfire - 23.05.2013

Bump....Come one guys....


Re: /setlevel problem - burnfire - 24.05.2013

UP!