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=442875)



Little Help - Sanady - 09.06.2013

Hello today I made my ban system but I got some errors.But in code I don`t see problem.If anyone see please reply here

pawn Код:
pBanInfo[id][pBanUserName] = pName[id];
    pBanInfo[id][pBanIP] = GetPlayerIp(id);
    pBanInfo[id][pBanReason] = reason;
    pBanInfo[id][pBanAdmin] = pName[playerid];
    pBanInfo[id][pBanCheck] = 1;
   
    format(str,sizeof(str), "INSERT INTO `serverbans` (Username,IP,Reason,Admin,CheckBan) VALUES ('%s', '%s', '%s', '%s', '%d')",pBanInfo[id][pBanUserName],pBanInfo[id][pBanIP],pBanInfo[id][pBanReason],pBanInfo[id][pBanAdmin],pBanInfo[id][pBanCheck]);
mysql_query(str);
ERRORS
Код:
D:\SA-MP Server Stuff\SA-MP Server\filterscripts\newworks.pwn(769) : error 006: must be assigned to an array
D:\SA-MP Server Stuff\SA-MP Server\filterscripts\newworks.pwn(770) : warning 202: number of arguments does not match definition
D:\SA-MP Server Stuff\SA-MP Server\filterscripts\newworks.pwn(770) : warning 202: number of arguments does not match definition
D:\SA-MP Server Stuff\SA-MP Server\filterscripts\newworks.pwn(771) : error 006: must be assigned to an array
D:\SA-MP Server Stuff\SA-MP Server\filterscripts\newworks.pwn(772) : error 006: must be assigned to an array
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Please help me


Re: Little Help - Guest123 - 09.06.2013

show error line lol


Re: Little Help - Sanady - 09.06.2013

Quote:
Originally Posted by Guest123
Посмотреть сообщение
show error line lol
I show error line "LOL" !


Re: Little Help - DeMoX - 09.06.2013

Quote:
Originally Posted by Sanady
Посмотреть сообщение
I show error line "LOL" !
Where's line 769?
And can you show us your ban info variables?


Re: Little Help - Tass007 - 09.06.2013

No you need to show what are at the lines of the errors not just the code because we can't help you not knowing what lines have the errors.


Re: Little Help - Sanady - 09.06.2013

This is line 769:
pawn Код:
pBanInfo[id][pBanUserName] = pName[id];
770:
pawn Код:
pBanInfo[id][pBanIP] = GetPlayerIp(id);
771:
pawn Код:
pBanInfo[id][pBanReason] = reason;
772:
pawn Код:
pBanInfo[id][pBanAdmin] = pName[playerid];



Re: Little Help - xFirex - 09.06.2013

he just say " LOL "and why the hell you -rep him, i'll -rep you too.


Re: Little Help - Sanady - 09.06.2013

Is here anyone normal to help me!?


Re: Little Help - Aly - 09.06.2013

Quote:
Originally Posted by Sanady
Посмотреть сообщение
Hello today I made my ban system but I got some errors.But in code I don`t see problem.If anyone see please reply here

pawn Код:
pBanInfo[id][pBanUserName] = pName[id];
    pBanInfo[id][pBanIP] = GetPlayerIp(id);
    pBanInfo[id][pBanReason] = reason;
    pBanInfo[id][pBanAdmin] = pName[playerid];
    pBanInfo[id][pBanCheck] = 1;
   
    format(str,sizeof(str), "INSERT INTO `serverbans` (Username,IP,Reason,Admin,CheckBan) VALUES ('%s', '%s', '%s', '%s', '%d')",pBanInfo[id][pBanUserName],pBanInfo[id][pBanIP],pBanInfo[id][pBanReason],pBanInfo[id][pBanAdmin],pBanInfo[id][pBanCheck]);
mysql_query(str);
ERRORS
Код:
D:\SA-MP Server Stuff\SA-MP Server\filterscripts\newworks.pwn(769) : error 006: must be assigned to an array
D:\SA-MP Server Stuff\SA-MP Server\filterscripts\newworks.pwn(770) : warning 202: number of arguments does not match definition
D:\SA-MP Server Stuff\SA-MP Server\filterscripts\newworks.pwn(770) : warning 202: number of arguments does not match definition
D:\SA-MP Server Stuff\SA-MP Server\filterscripts\newworks.pwn(771) : error 006: must be assigned to an array
D:\SA-MP Server Stuff\SA-MP Server\filterscripts\newworks.pwn(772) : error 006: must be assigned to an array
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Please help me
I supposed you have something like that:
pawn Код:
enum bInfo
{
 pBanUserName[64],
 pBanIP,
 pBanReason,
 pBanAdmin[64],
 pBanCheck,
};
new pBanInfo[MAX_PLAYERS][bInfo];
right?

I don't know what to say about that: pName[id]
You'd better use a stock:

pawn Код:
stock pName(playerid)
{
 new playername[MAX_PLAYER_NAME],str[80];
 GetPlayerName(playerid,playername,MAX_PLAYER_NAME);
 format(str,80,"%s",playername);
 return str;
}
One more thing: Replace
pawn Код:
pBanInfo[id][pBanUserName] = pName[id];
with
pawn Код:
format(pBanInfo[id][pBanUserName],64,"%s",pName(id));
and
pawn Код:
pBanInfo[id][pBanAdmin] = pName[playerid];
with
pawn Код:
format(pBanInfo[id][pBanAdmin],64,"%s",pName(playerid));
That's what I think about right now.
If you can show exactly the lines where the errors appear.
I mean something like that:
pawn Код:
769: pBanInfo[id][pBanUserName] = pName[id];



Re: Little Help - doreto - 09.06.2013

Quote:

must be assigned to an array

Here is your answer , you are trying to assigned string to integer which is not how it work