SA-MP Forums Archive
little 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: little help (/showthread.php?tid=597060)



little help - GeneralAref - 26.12.2015

i have this code but given me one error how t o fix it?
PHP код:
if(fexist(filestring) && (dini_Int(File,"Admin") >= 1)) return SendClientMessage(playeridCOLOR_RED"[Error]: You can not use offline ban on admins!"); 
PHP код:
C:\Users\Aref\Desktop\Aref\sampserver\pawno\CODv2.pwn(3072) : error 035argument type mismatch (argument 1



Re: little help - JaKe Elite - 26.12.2015

Remove the double ' ) ' on the end of >= 1, There should be only one ).


Re: little help - Ritzy2K - 26.12.2015

Quote:
Originally Posted by GeneralAref
Посмотреть сообщение
i have this code but given me one error how t o fix it?
PHP код:
if(fexist(filestring) && (dini_Int(File,"Admin") >= 1)) return SendClientMessage(playeridCOLOR_RED"[Error]: You can not use offline ban on admins!"); 
PHP код:
C:\Users\Aref\Desktop\Aref\sampserver\pawno\CODv2.pwn(3072) : error 035argument type mismatch (argument 1
Код:
if(fexist(filestring)) && (dini_Int(File,"Admin") >= 1) return SendClientMessage(playerid, COLOR_RED, "[Error]: You can not use offline ban on admins!")



Re: little help - GeneralAref - 26.12.2015

not works:
PHP код:
if(fexist(filestring) && dini_Int(File,"Admin") >= 1) return SendClientMessage(playeridCOLOR_RED"[Error]: You can not use offline ban on admins!"); 



Re: little help - Sh4d0w2 - 26.12.2015

Maybe the problem is the colour.
Try this
PHP код:
if(fexist(filestring) && dini_Int(File,"Admin") >= 1)) return SendClientMessage(playerid0xFF0000AA"[Error]: You can not use offline ban on admins!"); 
BTW, there's nothing wrong with his closing brackets I guess.


Re: little help - Karan007 - 26.12.2015

Try this.

PHP код:
if(fexist(filestring) && dini_Int(File,"Admin") >= 1)) return SendClientMessage(playeridCOLOR_RED"[Error]: You can not use offline ban on admins!"); 



Re: little help - GeneralAref - 26.12.2015

this is full code:
PHP код:
CMD:oban(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] == CmdsOptions[oban] || IsPlayerAdmin(playerid))
    {
        new 
targetname[24], filestring[79], adminname[MAX_PLAYER_NAME];
        if(
sscanf(params"s[24]"targetname)) return SendClientMessage(playeridCOLOR_RED"USAGE: /oban [Player's Name]");
        
format(filestringsizeof(filestring), "/Asystem/Users/%s.ini"targetname);
        if(!
fexist(filestring)) return SendClientMessage(playeridCOLOR_RED"[Error]: The player name you have chosen was not found in our system.");
        else
        {
            
GetPlayerName(playeridadminnamesizeof(adminname));
            new 
INI:File INI_Open(filestring);
            
INI_SetTag(File"data");
            
INI_WriteInt(File"Ban"1);
            
INI_Close(File);
            new 
done[128];
            
format(donesizeof(done), "[BAN] Admin %s (id:%d) Offlinebanned %s from server."adminnameplayeridtargetname);
            
SendClientMessageToAll(COLOR_REDdone);
            
printf("[BAN] Admin %s (id:%d) Offlinebanned %s from server."adminnameplayeridtargetname);
            return 
1;
        }
    }
    else return 
SendClientMessage(playerid,COLOR_RED,"You do not have permission to use this command!");