SA-MP Forums Archive
Error 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: Error Help (/showthread.php?tid=497095)



Error Help - ChandraLouis - 25.02.2014

(1295) : error 001: expected token: "*then", but found "-identifier-"
(1302) : error 001: expected token: "*then", but found "-identifier-"
(1460) : error 032: array index out of bounds (variable "NSpawns")
(465) : warning 204: symbol is assigned a value that is never used: "NP3"

pawn Код:
#define N_SKIN 115
#define SN_SKIN 107
new Float:NSpawns[][] =
{
    {-809.96, 2429.53, 156.97},
    {-771.69, 2424.31, 157.08},
    {-794.62, 2393.92, 159.50}
};
new NP3;
pawn Код:
Line 1295 : SetPlayerSkin(playerid, N_SKIN);
Line 1302 : SetPlayerSkin(playerid, SN_SKIN);
Line 1460 : SetPlayerFacingAngle(playerid, NSpawns[R andom][3]);
Line 465 : NP3 = CreatePickup(1254,2,-792.58, 2425.74, 157.15, -1);
Help Pls


Re: Error Help - faff - 25.02.2014

Код:
Line 1295 : SetPlayerSkin(playerid, N_SKIN);
Line 1302 : SetPlayerSkin(playerid, SN_SKIN);
Line 1460 : SetPlayerFacingAngle(playerid, NSpawns[random][3]);
Line 465 : NP3 = CreatePickup(1254,2,-792.58, 2425.74, 157.15, -1);
Correct me if i'm whrong.


Re: Error Help - Smileys - 25.02.2014

pawn Код:
Line 1295 : SetPlayerSkin(playerid, N_SKIN);
Line 1302 : SetPlayerSkin(playerid, SN_SKIN);
Line 1460 :
    new rand = random( sizeof( NSpawns[ ] ) );
    SetPlayerFacingAngle(playerid, NSpawns[rand][3]);
   
Line 465 : NP3 = CreatePickup(1254,2,-792.58, 2425.74, 157.15, -1);
https://sampwiki.blast.hk/wiki/Random

it needs a parameter!


Re: Error Help - BroZeus - 25.02.2014

show the line above line 1295 and 1302 that means show the line 1294 and 1301 and i have no idea about the 3rd error and
About the warning it means that u have assigned a value to NP3 but u have never used NP3 in any thing just ignore that warning


Re: Error Help - ChandraLouis - 25.02.2014

Line 1294 : if GetPlayerScore(playerid) >= 200
Line 1301 : if GetPlayerScore(playerid) >= 500


Re: Error Help - BroZeus - 25.02.2014

it should be if(GetPlayerScore(playerid) >= 200)
and if(GetPlayerScore(playerid) >= 500)


Re: Error Help - Konstantinos - 25.02.2014

You must use () in if statements.
pawn Код:
if (GetPlayerScore(playerid) >= 500)
{
    // code..
}
and

pawn Код:
if (GetPlayerScore(playerid) >= 200)
{
    // code..
}
And a note, that the last valid bound in the array NSpawns is 2.
pawn Код:
SetPlayerFacingAngle(playerid, NSpawns[Random][2]);



Re: Error Help - ChandraLouis - 25.02.2014

i got this error : (1309) : error 029: invalid expression, assumed zero
Line : {


Re: Error Help - Konstantinos - 25.02.2014

Do you think that the code from line 1309 ({) will help us that much? Post few lines before and few lines after the error line..


Re: Error Help - ChandraLouis - 25.02.2014

There you go
pawn Код:
if(classid == N1)
    {
        if GetPlayerScore(playerid) >= 500
        {
            SetPlayerSkin(playerid, SN_SKIN);
            GameTextForPlayer(playerid,"~b~Superior Necromancer",1000,4);
            SetPlayerColor(playerid, N_COLOR);
            gTeam[playerid] = N1;
        }
    }