[pomoc] errore


Započeo El Toni, Mart 12, 2014, 09:37:16 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: SC
Detaljan opis problema: radio sam lvl sistem (prebacivao iz jedan u drugi mod) i dosle errore neke i sad neznam da ih sredim pomoc.

Dio skripte:
Neke slike/video za lakse dobivanje pomoci(neobavezno):
errori
D:\SCRP v2.0.1 © 2013 by HOP3R and IVAN\gamemodes\SkyCityRP.pwn(40036) : error 017: undefined symbol "gPlayerLogged"
D:\SCRP v2.0.1 © 2013 by HOP3R and IVAN\gamemodes\SkyCityRP.pwn(40036) : warning 215: expression has no effect
D:\SCRP v2.0.1 © 2013 by HOP3R and IVAN\gamemodes\SkyCityRP.pwn(40036) : error 001: expected token: ";", but found "]"
D:\SCRP v2.0.1 © 2013 by HOP3R and IVAN\gamemodes\SkyCityRP.pwn(40036) : error 029: invalid expression, assumed zero
D:\SCRP v2.0.1 © 2013 by HOP3R and IVAN\gamemodes\SkyCityRP.pwn(40036) : 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.

linji
public ExpTimer()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
	    {
			if (gPlayerLogged[i] != 0)
			{
				if(PlayerInfo[i][pLevel] >= 0)
				{
					new nxtlevel = PlayerInfo[i][pLevel]+1;
					new expamount = nxtlevel*levelexp;
					new infostring[128];
					new string[128];
					if (PlayerInfo[i][pExp] < expamount)
					{
						return 1;
					}
					else
					{
						format(string, sizeof(string), "~y~POKACIVTE ~y~ LEVEL !");
						GameTextForPlayer(i, string, 5000, 4);
						PlayerPlaySound(i, 1052, 0.0, 0.0, 0.0);
						PlayerInfo[i][pLevel]++;
						if(PlayerInfo[i][pDonateRank] > 0)
						{
						    PlayerInfo[i][pExp] -= expamount;
						    new total = PlayerInfo[i][pExp];
						    if(total > 0)
						    {
						        PlayerInfo[i][pExp] = total;
						    }
						    else
						    {
						        PlayerInfo[i][pExp] = 0;
						    }
						}
						else
						{
							PlayerInfo[i][pExp] = 0;
	    	            }
					}
				}
				return 1;
			}
			else
			{
			}
	    }
	 }
}

error kaze da je kod ovo
if (gPlayerLogged[i] != 0)
			{
Poslednja Izmena: Mart 12, 2014, 09:37:58 PRE PODNE od [RF]hopp3Ra



Citat: [RF]hopp3Ra poslato Mart 12, 2014, 10:24:34 PRE PODNE
Citat: Ljubo poslato Mart 12, 2014, 09:59:39 PRE PODNE
definisi
gPlayerLogged

#define gPlayerLogged
tako?

ne nego ovako: new gPlayerLogged[MAX_PLAYERS];

My Bike KTM 450 SXF 2008

oke je to a ove kako da ih sredim
D:\SCRP v2.0.1 © 2013 by HOP3R and IVAN\gamemodes\SkyCityRP.pwn(40043) : warning 204: symbol is assigned a value that is never used: "infostring"
D:\SCRP v2.0.1 © 2013 by HOP3R and IVAN\gamemodes\SkyCityRP.pwn(40081) : warning 209: function "ExpTimer" should return a value
D:\SCRP v2.0.1 © 2013 by HOP3R and IVAN\gamemodes\SkyCityRP.pwn(2493) : warning 204: symbol is assigned a value that is never used: "exptimer"
D:\SCRP v2.0.1 © 2013 by HOP3R and IVAN\gamemodes\SkyCityRP.pwn(2494) : warning 204: symbol is assigned a value that is never used: "oneminute"
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase

40043: new infostring[128];
40081: ovo je posledna zagrada }
2493: exptimer = SetTimer("ExpTimer", 100, 1);
2494: oneminute = SetTimer("OneMinute", 60000, 1);


evo i linje

Probaj sada

public ExpTimer()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
	    {
			if (gPlayerLogged[i] != 0)
			{
				if(PlayerInfo[i][pLevel] >= 0)
				{
					new nxtlevel = PlayerInfo[i][pLevel]+1;
					new expamount = nxtlevel*levelexp;
					new string[128];
					if (PlayerInfo[i][pExp] < expamount)
					{
						return 1;
					}
					else
					{
						format(string, sizeof(string), "~y~POKACIVTE ~y~ LEVEL !");
						GameTextForPlayer(i, string, 5000, 4);
						PlayerPlaySound(i, 1052, 0.0, 0.0, 0.0);
						PlayerInfo[i][pLevel]++;
						if(PlayerInfo[i][pDonateRank] > 0)
						{
						    PlayerInfo[i][pExp] -= expamount;
						    new total = PlayerInfo[i][pExp];
						    if(total > 0)
						    {
						        PlayerInfo[i][pExp] = total;
						    }
						    else
						    {
						        PlayerInfo[i][pExp] = 0;
						    }
						}
						else
						{
							PlayerInfo[i][pExp] = 0;
	    	            }
					}
				}
				return 1;
			}
			else
			{
			}
	    }
	 }
	 return 1;
}

Blaeks

*

Madmen

samo ubij EXPTIMER pod ongamemodeexit