error 006: must be assigned to an array - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: error 006: must be assigned to an array (
/showthread.php?tid=65480)
error 006: must be assigned to an array -
Celson - 13.02.2009
Код:
dcmd_login(playerid, params[]) {
if(PLAYERLIST_authed[playerid]) return SystemMsg(playerid, "Already authed.");
if(!udb_Exists(PlayerName(playerid))) return SystemMsg(playerid, "Account doesn't exist! Please /register [password]");
if(strlen(params)==0) return SystemMsg(playerid, "Correct Usage: /login [password]");
if(udb_CheckLogin(PlayerName(playerid),params)) {
GivePlayerMoney(playerid, dUserINT(PlayerName(playerid)).("money")-GetPlayerMoney(playerid));
SetPlayerScore(playerid,dUserINT(PlayerName(playerid)).("kills"));
SetPlayerScore(playerid,(dUserINT(PlayerName(playerid)).("jetpacksstolen")*2)+GetPlayerScore(playerid));
SetPlayerScore(playerid,GetPlayerScore(playerid)-dUserINT(PlayerName(playerid)).("teamkills"));
PlayerData[playerid][PacksStolen] = (dUserINT(PlayerName(playerid)).("jetpacksstolen"));
PlayerData[playerid][Kicks] = (dUserINT(PlayerName(playerid)).("PlayerKicks"));
PlayerData[playerid][Bans] = (dUserINT(PlayerName(playerid)).("PlayerBans"));
PlayerData[playerid][AdminLevel] = (dUserINT(PlayerName(playerid)).("AdminLevel"));
PlayerData[playerid][Ispro] = (dUserINT(PlayerName(playerid)).("ispro"));
Pip[playerid][1] = PlayerIP(playerid); //2323
PLAYERLIST_authed[playerid] = true;
return SystemMsg(playerid, "Successfully authed!");
}
return SystemMsg(playerid, "Login Failed!");
}
stock PlayerIP(playerid)
{
new plrIP[16];
GetPlayerIp(playerid, plrIP, sizeof(plrIP));
return plrIP;
}
Код:
C:\samp02X.win32\Jetpack2.pwn(2323) : error 006: must be assigned to an array
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
Код:
Pip[playerid][1] = PlayerIP(playerid); //2323
Any ideas?
Re: error 006: must be assigned to an array -
Celson - 13.02.2009
Anybody at all have any help?
Re: error 006: must be assigned to an array -
Donny_k - 13.02.2009
"Pip[playerid]
[1]" - Your problem here is that you are tying to store sixteen characters into a single character space.
Re: error 006: must be assigned to an array -
Antironix - 13.02.2009
The function PlayerIP returns a string, use the format function.