Scripting Compile Errors - 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: Scripting Compile Errors (
/showthread.php?tid=403573)
Scripting Compile Errors -
JustinAn - 30.12.2012
Hey guys today I've a problem for the scripting compile errors.
Here they are..
Код:
C:\Users\default.Acer\Desktop\samp03e_svr_R2_win32\gamemodes\samp.pwn(8779) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
And here is my script.
It's a offline ban command.
pawn Код:
CMD:offlineban(playerid,params[])
{
new string[124],string1[124],giveplayername[24];
if(PlayerInfo[playerid][pAdmin] >= 4)
{
if(sscanf(params, "s", giveplayername)) { SendClientMessage(playerid, COLOR_GREY, "USAGE: /offlineban [full name(case sensative)]"); return 1; }
format(string,sizeof(string),"/Users/%s.ini",params);
if(fexist(string))
{
// This is the line >>> new INI:File = INI_Open(UserPath(string));
INI_SetTag(File,"data");
INI_WriteInt(File,"Banned",1);
INI_Close(File);
format(string1, sizeof(string1), "* You have sucessfully offline-banned %s from the server.", giveplayername);
SendClientMessage(playerid,COLOR_YELLOW,string1);
}
else SendClientMessage(playerid, COLOR_GRAD2, "Invalid player name specified in the database !");
}
else SendClientMessage(playerid, COLOR_GRAD2, NOTADMIN);
return 1;
}
I'm not quite sure on how to fix it, it's supposed to be new INI:File = INI_Open(UserPath(playerid)); and then I replaced it to 'string', but it didn't work. I also used this code in a tutorial. I looked at the comments and they had no problem. Not quite sure.I also have tried to rename 'string' to params.It's also supposed to be name 'string' in the tutorial.
If you'd like the link,
here.
Re: Scripting Compile Errors -
Feastahashi - 30.12.2012
pawn Код:
CMD:offlineban(playerid,params[])
{
new string[124],string1[124],giveplayername[24];
if(PlayerInfo[playerid][pAdmin] >= 4)
{
if(sscanf(params, "s", giveplayername)) { SendClientMessage(playerid, COLOR_GREY, "USAGE: /offlineban [full name(case sensative)]"); return 1; }
format(string,sizeof(string),"/Users/%s.ini",giveplayername);
if(fexist(string))
{
new INI:File; File = INI_Open(string);
INI_SetTag(File,"data");
INI_WriteInt(File,"Banned",1);
INI_Close(File);
format(string1, sizeof(string1), "* You have sucessfully offline-banned %s from the server.", giveplayername);
SendClientMessage(playerid,COLOR_YELLOW,string1);
}
else SendClientMessage(playerid, COLOR_GRAD2, "Invalid player name specified in the database !");
}
else SendClientMessage(playerid, COLOR_GRAD2, NOTADMIN);
return 1;
}
Re: Scripting Compile Errors -
RedCrossER - 30.12.2012
Quote:
Originally Posted by Feastahashi
pawn Код:
CMD:offlineban(playerid,params[]) { new string[124],string1[124],giveplayername[24]; if(PlayerInfo[playerid][pAdmin] >= 4) { if(sscanf(params, "s", giveplayername)) { SendClientMessage(playerid, COLOR_GREY, "USAGE: /offlineban [full name(case sensative)]"); return 1; } format(string,sizeof(string),"/Users/%s.ini",giveplayername); if(fexist(string)) { new INI:File; File = INI_Open(string); INI_SetTag(File,"data"); INI_WriteInt(File,"Banned",1); INI_Close(File); format(string1, sizeof(string1), "* You have sucessfully offline-banned %s from the server.", giveplayername); SendClientMessage(playerid,COLOR_YELLOW,string1); } else SendClientMessage(playerid, COLOR_GRAD2, "Invalid player name specified in the database !"); } else SendClientMessage(playerid, COLOR_GRAD2, NOTADMIN); return 1; }
|
Please describe to him what was wrong in the code then only he can understand and use in future
Re: Scripting Compile Errors -
JustinAn - 30.12.2012
Quote:
Originally Posted by RedCrossER
Please describe to him what was wrong in the code then only he can understand and use in future
|
No need to man, I can understand right away.
And thanks by the way too the 2 of you guys.
@Feastahashi - +REPed