SA-MP Forums Archive
offban error - 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: offban error (/showthread.php?tid=598869)



offban error - NoDi522 - 17.01.2016

Nothing to explain. Take a look.

PHP код:
CMD:offban(playerid,params[])
{
    new 
poruka[256],BanIme[MAX_PLAYER_NAME],Razlog,FileString[128];
    if(!
IsPlayerConnected(playerid)) return SendClientMessage(playerid,-1,"{FF0000}Greska:{FFFFFF} Niste se spojili na server");
    if(
pUlogiran[playerid] != 1) return SendClientMessage(playerid,-1,"{FF0000}Greska:{FFFFFF} Niste ulogirani na server.");
    if(
PlayerInfo[playerid][pAdministrator] < 5) return SendClientMessage(playerid,-1,"{FF0000}Greska:{FFFFFF} Nemate dozvolu za tu komandu");
    if(
ADuty[playerid] != 1) return SendClientMessage(playerid,-1,"{FF0000}Greska:{FFFFFF} Niste uzeli administratorsku duznost (/aduty)");
    if(
sscanf(params,"s[MAX_PLAYER_NAME]s",BanIme,Razlog)) return SendClientMessage(playerid,-1,"{FF0000}Koristenje:{FFFFFF} /banoffline [Ime_Prezime] [Razlog]");
    {
        
format(FileString,sizeof(FileString),"/Korisnici/%s.ini",BanIme);
        if(!
fexist(FileString)) return SendClientMessage(playerid,-1,"{FF0000}Greska:{FFFFFF} Upisano ime nije pronadeno u databazi.");
        else
        {
            if(
Razlog || Razlog 20) return SendClientMessage(playerid,-1,"{FF0000}Greska:{FFFFFF} Razlog moze sadrzavati minimalno 5 i maximalno 20 slova");
              new 
ime[128];
            
GetPlayerName(playerid,ime,128);
            new 
INI:File INI_Open(FileString);
            
INI_SetTag(File,"Podatci");
            
INI_WriteInt(File,"pBanned",1);
            
INI_WriteString(File,"pBanReason",Razlog);
            
INI_WriteString(File,"pBannedBy",ime);
            
INI_Close(File);
            
            
format(poruka,256,"{0080FF}WG:{FFFFFF} Uspjesno ste banali offline igraca: %s.",BanIme);
            
SendClientMessage(playerid,-1,poruka);
            
format(poruka,256,"{FF0000}[A-INFO]: %s %s je banovo offline igraca %sa.",GetPlayerAdminRank(playerid),GetName(playerid),BanIme);
            
SendAdminMessage(-1,poruka);
        }
    }
    return 
1;

Error:
PHP код:
gamemodes\WGRP.pwn(1452) : error 035argument type mismatch (argument 3
Error line:
PHP код:
INI_WriteString(File,"pBanReason",Razlog); 



Re: offban error - NoDi522 - 17.01.2016

Thanks.

++
PHP код:
if(Razlog || Razlog 20) return SendClientMessage(playerid,-1,"{FF0000}Greska:{FFFFFF} Razlog moze sadrzavati minimalno 5 i maximalno 20 slova"); 
Is now:

PHP код:
if(strlen(Razlog) < || strlen(Razlog) > 20) return SendClientMessage(playerid,-1,"{FF0000}Greska:{FFFFFF} Razlog moze sadrzavati minimalno 5 i maximalno 20 slova"); 
Cheers!