Isbanned - 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: Isbanned (
/showthread.php?tid=397092)
Isbanned -
Face9000 - 03.12.2012
Hello, i just made this command to check if a player (offline) is banned or not. It reads from the player file but there is a problem:
pawn Код:
CMD:isbanned(playerid,params[])
{
if(PlayerInfo[playerid][pLogged] == 0) return SCM(playerid,0x0080C0FF,"Please login before using this command.");
if(PlayerInfo[playerid][pAdmin] >= 1)
{
new name[128];
if(sscanf(params, "s[128]",name)) return SCM(playerid,-1,"{F70505}Usage: {FFFFFF}/isbanned <account name>");
new string[128];
new ss;
new filestring[128];
format(filestring, sizeof(filestring), "Users/%s.ini", name);
if(!fexist(filestring)) return SCM(playerid,red, "Player account not found.");
else
{
new INI:File = INI_Open(filestring);
INI_SetTag(File, "data");
ss = INI_Load("Banned", name);
INI_Close(File);
switch(ss)
{
case 0:
{
format(string,sizeof string,"%s's account is banned.");
SCM(playerid,COLOR_YELLOW,string);
}
case 1:
{
format(string,sizeof string,"%s's account is not banned.");
SCM(playerid,COLOR_YELLOW,string);
}
}
}
}
return 1;
}
(7453) : error 035: argument type mismatch (argument 2)
Line 7453:
pawn Код:
ss = INI_Load("Banned", name);
Thanks.
Re: Isbanned -
Konstantinos - 03.12.2012
Change to
Re: Isbanned -
cosbraa - 03.12.2012
I don't think INI_Load returns what is stored in "Banned".
Re: Isbanned -
Face9000 - 03.12.2012
Quote:
Originally Posted by cosbraa
I don't think INI_Load returns what is stored in "Banned".
|
Then what?
Quote:
Originally Posted by Dwane
|
error 035: argument type mismatch (argument 2)
error 033: array must be indexed (variable "ss")
error 033: array must be indexed (variable "-unknown-")
Re: Isbanned -
Konstantinos - 03.12.2012
Actually, it should be like this
pawn Код:
// An example || Originally posted by ******
INI_Load("myini.ini");
INI:myini[](name[], value[])
{
INI_String("a", gA, len_of_gA);
INI_String("b", gB, len_of_gB);
INI_String("c", gC, len_of_gC);
return 0; // This is now required.
}
You cannot use
as you did.
Re: Isbanned -
[HK]Ryder[AN] - 03.12.2012
you can use INI_Int
Re: Isbanned -
Face9000 - 04.12.2012
Nope, doesn't work.
Re: Isbanned -
Gh05t_ - 04.12.2012
Quote:
Originally Posted by ******
Have you even read the y_ini tutorial?
|
A better question would have been has he read ANYTHING at all!
Quote:
Originally Posted by Logitech90
Join Date: Jan 2010
Posts: 2,588
Reputation: 162
|
You have been spoon-fed throughout ALL your time here on the SA-MP forums. Some thoughtful advice: USE the internet!