SA-MP Forums Archive
Help! - 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: Help! (/showthread.php?tid=610836)



Help! - Filbert - 29.06.2016

I made this command >
PHP код:
CMD:osetlevel(playerid,params[])
{
            if(
IsPlayerAdmin(playerid))
            {
                new 
file[256];
                new 
tmp[128], tmp2[128], Index;        tmp strtok(params,Index), tmp2 strtok(params,Index);
                if(
isnull(params)) return SendClientMessage(playeridred"USAGE: /osetlevel [name] [level]");
                if(
isnull(tmp2)) return SendClientMessage(playeridred"ERROR: You must give a reason");
                   
format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(tmp));
                   if(!
fexist(file)) return SendClientMessage(playeridred"ERROR: that account don't even exist!");
                   
dini_Set(file,"level",tmp2);
                   new 
year,month,day;   getdate(yearmonthday); new hour,minute,secondgettime(hour,minute,second);
                   
format(ystring,sizeof(ystring),"You have set %s's level to %s on %d/%d/%d at %d:%d:%d",tmp,tmp2 ,daymonthyearhourminutesecond );
                   return 
SendClientMessage(playerid,blue,ystring);
            } else return 
SendClientMessage(playerid,red,"ERROR: Player must be registered to be admin");
        } else return 
SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
    } else return 
SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");

But, I found this Error >
Код:
D:\Data\Filbert\SA-MP Server\SGTDM~RP\Gamemodes\SGTDM~RP.pwn(31333) : error 010: invalid function or declaration
D:\Data\Filbert\SA-MP Server\SGTDM~RP\Gamemodes\SGTDM~RP.pwn(31334) : error 010: invalid function or declaration
Please Help Me


Re: Help! - SkillNasr - 29.06.2016

PHP код:
CMD:osetlevel(playerid,params[]) 

            if(
IsPlayerAdmin(playerid)) 
            { 
                new 
file[256]; 
                new 
tmp[128], tmp2[128], Index;        tmp strtok(params,Index), tmp2 strtok(params,Index); 
                if(
isnull(params)) return SendClientMessage(playeridred"USAGE: /osetlevel [name] [level]"); 
                if(
isnull(tmp2)) return SendClientMessage(playeridred"ERROR: You must give a reason"); 
                   
format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(tmp)); 
                   if(!
fexist(file)) return SendClientMessage(playeridred"ERROR: that account don't even exist!"); 
                   
dini_Set(file,"level",tmp2); 
                   new 
year,month,day;   getdate(yearmonthday); new hour,minute,secondgettime(hour,minute,second); 
                   
format(ystring,sizeof(ystring),"You have set %s's level to %s on %d/%d/%d at %d:%d:%d",tmp,tmp2 ,daymonthyearhourminutesecond ); 
                   return 
SendClientMessage(playerid,blue,ystring); 
            } 
       else return 
SendClientMessage(playerid,red,"ERROR: Player must be registered to be admin"); 
        } 
    else return 
SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command"); 
    } 
   else return 
SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands"); 

it probably be this, the brackets...


Re: Help! - Filbert - 29.06.2016

Same Error


Re: Help! - AaronJ - 29.06.2016

Quote:
Originally Posted by Filbert
Посмотреть сообщение
I made this command >
PHP код:
CMD:osetlevel(playerid,params[])
{
            if(
IsPlayerAdmin(playerid))
            {
                new 
file[256];
                new 
tmp[128], tmp2[128], Index;        tmp strtok(params,Index), tmp2 strtok(params,Index);
                if(
isnull(params)) return SendClientMessage(playeridred"USAGE: /osetlevel [name] [level]");
                if(
isnull(tmp2)) return SendClientMessage(playeridred"ERROR: You must give a reason");
                   
format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(tmp));
                   if(!
fexist(file)) return SendClientMessage(playeridred"ERROR: that account don't even exist!");
                   
dini_Set(file,"level",tmp2);
                   new 
year,month,day;   getdate(yearmonthday); new hour,minute,secondgettime(hour,minute,second);
                   
format(ystring,sizeof(ystring),"You have set %s's level to %s on %d/%d/%d at %d:%d:%d",tmp,tmp2 ,daymonthyearhourminutesecond );
                   return 
SendClientMessage(playerid,blue,ystring);
            } else return 
SendClientMessage(playerid,red,"ERROR: Player must be registered to be admin");
        } else return 
SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
    } else return 
SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");

But, I found this Error >
Код:
D:\Data\Filbert\SA-MP Server\SGTDM~RP\Gamemodes\SGTDM~RP.pwn(31333) : error 010: invalid function or declaration
D:\Data\Filbert\SA-MP Server\SGTDM~RP\Gamemodes\SGTDM~RP.pwn(31334) : error 010: invalid function or declaration
Please Help Me
Can you mark the two lines please?