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: ERRORS. (
/showthread.php?tid=582152)
ERRORS. -
SpikeSpigel - 18.07.2015
I wanted to made myself a MySQL connection to my own gamemode and I made a login/register system and I wanted to save the player on it's exit.. and-.. errors.
errors
Код:
C:\Users\SpikeSpigel\Desktop\MyGamemode.pwn(90) : warning 219: local variable "query" shadows a variable at a preceding level
C:\Users\SpikeSpigel\Desktop\MyGamemode.pwn(90) : warning 219: local variable "pName" shadows a variable at a preceding level
C:\Users\SpikeSpigel\Desktop\MyGamemode.pwn(279) : warning 219: local variable "query" shadows a variable at a preceding level
C:\Users\SpikeSpigel\Desktop\MyGamemode.pwn(279) : warning 219: local variable "pName" shadows a variable at a preceding level
C:\Users\SpikeSpigel\Desktop\MyGamemode.pwn(301) : warning 219: local variable "query" shadows a variable at a preceding level
C:\Users\SpikeSpigel\Desktop\MyGamemode.pwn(301) : warning 219: local variable "pName" shadows a variable at a preceding level
C:\Users\SpikeSpigel\Desktop\MyGamemode.pwn(322) : warning 219: local variable "query" shadows a variable at a preceding level
C:\Users\SpikeSpigel\Desktop\MyGamemode.pwn(322) : warning 219: local variable "pName" shadows a variable at a preceding level
C:\Users\SpikeSpigel\Desktop\MyGamemode.pwn(339) : error 055: start of function body without function header
C:\Users\SpikeSpigel\Desktop\MyGamemode.pwn(341) : error 021: symbol already defined: "GetPlayerName"
C:\Users\SpikeSpigel\Desktop\MyGamemode.pwn(343) : error 021: symbol already defined: "format"
C:\Users\SpikeSpigel\Desktop\MyGamemode.pwn(347) : error 021: symbol already defined: "SpawnPlayer"
C:\Users\SpikeSpigel\Desktop\MyGamemode.pwn(349) : warning 203: symbol is never used: "pName"
C:\Users\SpikeSpigel\Desktop\MyGamemode.pwn(349) : warning 203: symbol is never used: "query"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Andd-.. the lines with problems.
Код:
stock SavePlayer(playerid);
{
new query[126], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName)
format(query, sizeof(query), "UPDATE accounts SET Username = '%s', Password = '%s' WHERE Username = '&s'", pName, Player[playerid][Password], pName);
mysql_query(query);
mysql_store_result();
SpawnPlayer(playerid);
}
The f'ck is bugged ?
Re: ERRORS. -
zT KiNgKoNg - 18.07.2015
Hi Spike,
Do you have any existing variables name "pName" and "Query" anywhere else in the script, such as the top; If so thats your problem, anything inside a stock or "public" shouldn't cause this issue.
Re: ERRORS. -
SpikeSpigel - 18.07.2015
I do. On the upper stock (LoginPlayer) .. I can't use a local variable for more stock or ?
LoginPlayer
Код:
stock LoginPlayer(playerid)
{
new query[126], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(query, sizeof(query), "SELECT FROM * accounts WHERE name = '%s'", pName);
mysql_query(query);
mysql_store_result();
while(mysql_fetch_row(query, " "))
{
mysql_fetch_row(Player[playerid][Username], "Username");
mysql_fetch_row(Player[playerid][Password], "Password");
}
SpawnPlayer(playerid);
}
Doesn't matter-.. I resolved that. It happend cuz I had the saveplayer like that.. stock SavePlayer(playerid); when it should be SavePlayer(playerid)