#1

Quote:

public LitaiXP(playerid)
{
if(IsPlayerConnected(playerid)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new alga[454], msg[128];
if(GetPlayerScore(playerid) > 2000){alga = playerDB[playerid][alga]+=30;}
else if(GetPlayerScore(playerid) > 2500){alga = playerDB[playerid][alga]+=33;}
else if(GetPlayerScore(playerid) > 3000){alga = playerDB[playerid][alga]+=39;}
else if(GetPlayerScore(playerid) > 3500){alga = playerDB[playerid][alga]+=45;}
else if(GetPlayerScore(playerid) > 4000){alga = playerDB[playerid][alga]+=49;}
else if(GetPlayerScore(playerid) > 5000){alga = playerDB[playerid][alga]+=53;}
else if(GetPlayerScore(playerid) > 10000)alga = {playerDB[playerid][alga]+=73;}
else if(GetPlayerScore(playerid) > 12000){alga = playerDB[playerid][alga]+=84;}
else if(GetPlayerScore(playerid) > 15000){alga = playerDB[playerid][alga]+=100;}
else if(GetPlayerScore(playerid) > 19000){alga = playerDB[playerid][alga]+=121;}
else if(GetPlayerScore(playerid) > 23000){alga = playerDB[playerid][alga]+=151;}
else if(GetPlayerScore(playerid) > 29000){alga = playerDB[playerid][alga]+=243;}
else if(GetPlayerScore(playerid) > 35000){alga = playerDB[playerid][alga]+=350;}
else if(GetPlayerScore(playerid) > 40000){alga = playerDB[playerid][alga]+=402;}
else if(GetPlayerScore(playerid) > 45000){alga = playerDB[playerid][alga]+=500;}
else if(GetPlayerScore(playerid) > 52000){alga = playerDB[playerid][alga]+=602;}
else if(GetPlayerScore(playerid) > 56000){alga = playerDB[playerid][alga]+=813;}
else if(GetPlayerScore(playerid) > 70000){alga = playerDB[playerid][alga]+=1012;}
else if(GetPlayerScore(playerid) > 100000){alga = playerDB[playerid][alga]+=1300;}
else if(GetPlayerScore(playerid) > 300000){alga = playerDB[playerid][alga]+=1500;}
else if(GetPlayerScore(playerid) > 500000){alga = playerDB[playerid][alga]+=2000;}
else if(GetPlayerScore(playerid) > 600000){alga = playerDB[playerid][alga]+=3000;}
format(msg, 128, sizeof(msg), "Ismoketa alga! (%i LT)", alga);
SendClientMessage(playerid, PILKA, msg);
}
return 1;
}
return 1;
}

and i get
Quote:

C:\Documents and Settings\Admin\Desktop\Andriaus\Serveriai\rLKG\gam emodes\rLKG.pwn(15266) : error 001: expected token: ")", but found "{"
C:\Documents and Settings\Admin\Desktop\Andriaus\Serveriai\rLKG\gam emodes\rLKG.pwn(15269) : warning 219: local variable "alga" shadows a variable at a preceding level
C:\Documents and Settings\Admin\Desktop\Andriaus\Serveriai\rLKG\gam emodes\rLKG.pwn(15270) : error 022: must be lvalue (non-constant)
C:\Documents and Settings\Admin\Desktop\Andriaus\Serveriai\rLKG\gam emodes\rLKG.pwn(15271) : error 022: must be lvalue (non-constant)
C:\Documents and Settings\Admin\Desktop\Andriaus\Serveriai\rLKG\gam emodes\rLKG.pwn(15272) : error 022: must be lvalue (non-constant)
C:\Documents and Settings\Admin\Desktop\Andriaus\Serveriai\rLKG\gam emodes\rLKG.pwn(15273) : error 022: must be lvalue (non-constant)
C:\Documents and Settings\Admin\Desktop\Andriaus\Serveriai\rLKG\gam emodes\rLKG.pwn(15274) : error 022: must be lvalue (non-constant)
C:\Documents and Settings\Admin\Desktop\Andriaus\Serveriai\rLKG\gam emodes\rLKG.pwn(15275) : error 022: must be lvalue (non-constant)
C:\Documents and Settings\Admin\Desktop\Andriaus\Serveriai\rLKG\gam emodes\rLKG.pwn(15276) : error 022: must be lvalue (non-constant)
C:\Documents and Settings\Admin\Desktop\Andriaus\Serveriai\rLKG\gam emodes\rLKG.pwn(15277) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Admin\Desktop\Andriaus\Serveriai\rLKG\gam emodes\rLKG.pwn(15277) : warning 215: expression has no effect
C:\Documents and Settings\Admin\Desktop\Andriaus\Serveriai\rLKG\gam emodes\rLKG.pwn(15277) : error 001: expected token: ";", but found "if"
C:\Documents and Settings\Admin\Desktop\Andriaus\Serveriai\rLKG\gam emodes\rLKG.pwn(15277) : error 022: must be lvalue (non-constant)
C:\Documents and Settings\Admin\Desktop\Andriaus\Serveriai\rLKG\gam emodes\rLKG.pwn(15277) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


12 Errors.

Reply
#2

I dont know if that causes the error, but actually you are doing the same everytime. If i take the numer 600001 as example. It will take every case because 600001 is also above 2000. Try to use multiple lines like:
pawn Код:
if (example > 12000 && example < 20000)
{
       //do something
       return 1;
}
This will give you a more clean code, and it will be easyer to find bugs/errors.
and return something too so it will stop scanning for other cases once it founded the good one.

Edit:
Also READ your warnings/errors before posting guys, like this one as example:

error 001: expected token: ";", but found "if" - You forgot an ;
error 001: expected token: ")", but found "{" - You forgot an )

All these errors/warnings are small "messy" mistakes which could be prevented by scripting cleaner (so not try to put EVERYTHING on one line). Then its also easyer to find where the error is and to fix it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)