Simple Errors :( -
Black Axe - 04.06.2012
Well.. I am still learning how to script - So.. i've made a Code , But i am facing Some Errors :
PHP код:
{//RELOGGING
new housekey = PlayerInfo[playerid][pPhousekey];
TextDrawShowForPlayer(playerid, Title);
TextDrawShowForPlayer(playerid, Server);
TextDrawShowForPlayer(playerid, Forums);
TextDrawShowForPlayer(playerid, Version);
TextDrawShowForPlayer(playerid, vAnnounce);
else if PlayerInfo[playerid][pJailed] = 2;
{
SetPlayerPos(playerid, PlayerInfo[playerid][pSPos_x], PlayerInfo[playerid][pSPos_y], PlayerInfo[playerid][pSPos_z]);
SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pSPos_r]);
SetPlayerHealth(playerid, 100);
}
else
{
else if PlayerInfo[playerid][pPhousekey] = 1);
{
SetPlayerPos(playerid, HouseInfo[hExteriorX],HouseInfo[hExteriorY], HouseInfo[hExteriorZ]);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]);
}
else
{
else if PlayerInfo[playerid][pJailed] = 0 && PlayerInfo[playerid][pHouseKey] = 0);
{
SetPlayerPos(playerid, 1733.1367,-1911.9568,13.5621);
SetPlayerHealth(playerid, 100);
}
CanTalk[playerid] = 1;
SetPlayerToTeamColor(playerid);
}
}
}
}
}
Line 19754 :
PHP код:
else if PlayerInfo[playerid][pJailed] = 2;
PHP код:
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19754) : error 029: invalid expression, assumed zero
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19754) : warning 215: expression has no effect
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19754) : error 001: expected token: ";", but found "if"
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19754) : warning 211: possibly unintended assignment
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19754) : error 001: expected token: "*then", but found ";"
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19754) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.]
- Hope you can help me xD
Re: Simple Errors :( -
newbienoob - 04.06.2012
Here's your problem
pawn Код:
else if PlayerInfo[playerid][pJailed] = 2;
else if PlayerInfo[playerid][pPhousekey] = 1);
else if PlayerInfo[playerid][pJailed] = 0 && PlayerInfo[playerid][pHouseKey] = 0);
It should be
pawn Код:
else if (PlayerInfo[playerid][pJailed] = 2)
else if (PlayerInfo[playerid][pPhousekey] = 1)
else if (PlayerInfo[playerid][pJailed] = 0 && PlayerInfo[playerid][pHouseKey] = 0)
Re: Simple Errors :( -
Black Axe - 04.06.2012
Didn't work..
Here's what i did :
PHP код:
{//RELOGGING
new housekey = PlayerInfo[playerid][pPhousekey];
TextDrawShowForPlayer(playerid, Title);
TextDrawShowForPlayer(playerid, Server);
TextDrawShowForPlayer(playerid, Forums);
TextDrawShowForPlayer(playerid, Version);
TextDrawShowForPlayer(playerid, vAnnounce);
if(PlayerInfo[playerid][pJailed] == 2)
{
SetPlayerPos(playerid, PlayerInfo[playerid][pSPos_x], PlayerInfo[playerid][pSPos_y], PlayerInfo[playerid][pSPos_z]);
SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pSPos_r]);
SetPlayerHealth(playerid, 100);
}
else
{
else if(PlayerInfo[playerid][pPhousekey] == 1);
{
SetPlayerPos(playerid, HouseInfo[hExteriorX],HouseInfo[hExteriorY], HouseInfo[hExteriorZ]);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]);
}
else
{
else if (PlayerInfo[playerid][pJailed] = 0 && PlayerInfo[playerid][pHouseKey] = 0)
{
SetPlayerPos(playerid, 1733.1367,-1911.9568,13.5621);
SetPlayerHealth(playerid, 100);
}
CanTalk[playerid] = 1;
SetPlayerToTeamColor(playerid);
}
}
}
}
}
Error Line :
PHP код:
else if(PlayerInfo[playerid][pPhousekey] == 1);
PHP код:
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19762) : error 029: invalid expression, assumed zero
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19762) : warning 215: expression has no effect
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19762) : error 001: expected token: ";", but found "if"
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19762) : error 036: empty statement
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19762) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
Re: Simple Errors :( -
newbienoob - 04.06.2012
Remove ;
It should be
pawn Код:
else if(PlayerInfo[playerid][pPhousekey] == 1)
Re: Simple Errors :( -
Black Axe - 04.06.2012
Did it and..
PHP код:
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19762) : error 029: invalid expression, assumed zero
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19762) : warning 215: expression has no effect
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19762) : error 001: expected token: ";", but found "if"
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19764) : error 035: argument type mismatch (argument 2)
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19770) : error 029: invalid expression, assumed zero
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19770) : warning 215: expression has no effect
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19770) : error 001: expected token: ";", but found "if"
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19770) : warning 211: possibly unintended assignment
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19770) : warning 211: possibly unintended assignment
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19770) : error 022: must be lvalue (non-constant)
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19770) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
7 Errors.
Line 19770 :
PHP код:
else if (PlayerInfo[playerid][pJailed] = 0 && PlayerInfo[playerid][pPhousekey] = 0)
Re: Simple Errors :( -
ricardo178 - 04.06.2012
This will work for sure:
pawn Код:
{//RELOGGING
new housekey = PlayerInfo[playerid][pPhousekey];
TextDrawShowForPlayer(playerid, Title);
TextDrawShowForPlayer(playerid, Server);
TextDrawShowForPlayer(playerid, Forums);
TextDrawShowForPlayer(playerid, Version);
TextDrawShowForPlayer(playerid, vAnnounce);
if(PlayerInfo[playerid][pJailed] == 2)
{
SetPlayerPos(playerid, PlayerInfo[playerid][pSPos_x], PlayerInfo[playerid][pSPos_y], PlayerInfo[playerid][pSPos_z]);
SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pSPos_r]);
SetPlayerHealth(playerid, 100);
}
else
{
else if(PlayerInfo[playerid][pPhousekey] == 1)
{
SetPlayerPos(playerid, HouseInfo[hExteriorX],HouseInfo[hExteriorY], HouseInfo[hExteriorZ]);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]);
}
else
{
else if (PlayerInfo[playerid][pJailed] == 0 && PlayerInfo[playerid][pHouseKey] == 0)
{
SetPlayerPos(playerid, 1733.1367,-1911.9568,13.5621);
SetPlayerHealth(playerid, 100);
}
CanTalk[playerid] = 1;
SetPlayerToTeamColor(playerid);
}
}
}
}
}
Some tips:
Never put ; after if,
= sets a variable to soemthing,
== checks if the variable is equal to something,
!= checks if the variable is different from something,
>= compares if a variable is bigger or equal to other,
<= compares if a variable is smaller or equal to other,
+ adds,
- takes off,
* multiplicate,
/ devides.
Re: Simple Errors :( -
newbienoob - 04.06.2012
Try this
pawn Код:
else if (PlayerInfo[playerid][pJailed] == 0 && PlayerInfo[playerid][pPhousekey] == 0)
EDIT: too late.....
Re: Simple Errors :( -
Black Axe - 04.06.2012
@Recardo - did it and..
PHP код:
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19762) : error 029: invalid expression, assumed zero
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19762) : warning 215: expression has no effect
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19762) : error 001: expected token: ";", but found "if"
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19764) : error 035: argument type mismatch (argument 2)
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19770) : error 029: invalid expression, assumed zero
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19770) : warning 215: expression has no effect
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19770) : error 001: expected token: ";", but found "if"
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(19748) : warning 204: symbol is assigned a value that is never used: "housekey"
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(22770) : warning 216: nested comment
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(22785) : warning 216: nested comment
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(22803) : warning 216: nested comment
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(22821) : warning 216: nested comment
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(22838) : warning 216: nested comment
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(22853) : warning 216: nested comment
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(22870) : warning 216: nested comment
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(22878) : warning 216: nested comment
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(51965) : warning 219: local variable "string" shadows a variable at a preceding level
E:\G.T.A San Andreas [SAMP]\Server - Scripting Related\SA-MP Servers\GTA-RP v.1.09.1\gamemodes\AL-RP.pwn(71860) : warning 203: symbol is never used: "SkinOffSet"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
5 Errors.
- Note : Ignore the nested comments
Re: Simple Errors :( -
Black Axe - 05.06.2012
- Fifth Page in 24 Hour
- Bump.
- Still need help..
Re: Simple Errors :( -
Firo - 05.06.2012
You did
else twice..