#1

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
Reply
#2

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...
Reply
#3

Same Error
Reply
#4

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?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)