SA-MP Forums Archive
1 Error In 1 Line - 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: 1 Error In 1 Line (/showthread.php?tid=359933)



1 Error In 1 Line - misho1 - 15.07.2012

Hi,
I Get It Error From That
pawn Код:
INI_WriteInt(file,"AdminLevel",PInfo[playerid][Adminlevel]);
And I Don't See Any Thing Wrong With That

Код:
error 035: argument type mismatch (argument 1)
Thanks


Re: 1 Error In 1 Line - tiernantheman - 15.07.2012

Try putting a capital F for File. Happened to me before and that fixed it. If not show us more code please or previous lines or more.


Re: 1 Error In 1 Line - misho1 - 15.07.2012

It Will Say Undefine Symbol File


Re: 1 Error In 1 Line - tiernantheman - 15.07.2012

Hmm weird. Could you possibly post the whole bit of your saving please?


Re: 1 Error In 1 Line - GSRP - 15.07.2012

make sure you have
pawn Код:
new INI:file;
above that.


Re: 1 Error In 1 Line - misho1 - 15.07.2012

Now I Got That
Код:
error 035: argument type mismatch (argument 1)
2 Times


Re: 1 Error In 1 Line - ViniBorn - 15.07.2012

Ex:
pawn Код:
new file[32],pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName, MAX_PLAYER_NAME);

format(file, sizeof file, "%s.ini",pName);

new INI:ini = INI_Open(file);



Re: 1 Error In 1 Line - misho1 - 15.07.2012

Symbol INI Is Never Used + error 035: argument type mismatch (argument 1)


Re: 1 Error In 1 Line - ViniBorn - 15.07.2012

pawn Код:
new file[32],pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName, MAX_PLAYER_NAME);

format(file, sizeof file, "%s.ini",pName);

new INI:ini = INI_Open(file);
INI_WriteInt(ini,"AdminLevel",PInfo[playerid][Adminlevel]); // Usage



Re: 1 Error In 1 Line - misho1 - 16.07.2012

No Error But When I Type /setadmin Thats Happen
Код:
[05:18:32] *** YSI Error: INI_Open could not find or create file 
[05:18:34] *** YSI Error: INI_Open could not find or create file 
[05:18:38] *** YSI Error: INI_Open could not find or create file 
[05:18:41] *** YSI Error: INI_Open could not find or create file
Here Is My SetAdmin Cmd
pawn Код:
YCMD:setadmin(playerid, params[], help)
            {
            new level,id,n[MAX_PLAYER_NAME];
            new string[50];
            new on[MAX_PLAYER_NAME];
            new file[32],pName[MAX_PLAYER_NAME];
            new INI:ini = INI_Open(file);
            GetPlayerName(id,n,MAX_PLAYER_NAME);
            GetPlayerName(id,on,sizeof(on));
            format(file,sizeof(file),"MAdmin/Players/%s.txt",n);
            if(PInfo[playerid][Adminlevel] < 6) return SendClientMessage(playerid,ORANGE,"You're Not Rcon Admin!");
            if(sscanf(params,"ud",id,level)) return SendClientMessage(playerid,RED,"USAGE:/SetLevel [Playerid] [Level]");
            if(!IsPlayerConnected(id))return SendClientMessage(playerid,GREY,"You have entered an incorrect ID");
            PInfo[id][Adminlevel] = level;
            format(string,sizeof(string),"You have set %s's level to %d",on,level);
            SendClientMessage(playerid,LIGHTBLUE,string);
            format(string,sizeof(string),"Player %s Is Now Admin Level %d",on,level);
            SendClientMessageToAll(GREEN,string);
            GetPlayerName(playerid,pName, MAX_PLAYER_NAME);
            format(file, sizeof file, "Players/%s.ini",pName);
            INI_WriteInt(ini,"AdminLevel",PInfo[playerid][Adminlevel]);
            return 1;
    }