How to? - 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: How to? (
/showthread.php?tid=459485)
How to? -
Gamer_007 - 23.08.2013
pawn Код:
stock GetScore(playerid)
{
new Zscore[64];
if(GetPlayerScore(playerid) < 1000)
{
format(Zscore, sizeof(Zscore), "Score: %d{FF0000}/1000",GetPlayerScore(playerid));
}
if(GetPlayerScore(playerid) > 1000 < 10000)
{
format(Zscore, sizeof(Zscore), "Score: %d{FF0000}/10000",GetPlayerScore(playerid));
}
if(GetPlayerScore(playerid) >= 10000 && <= 100000)
{
format(Zscore, sizeof(Zscore), "Score: %d{FF0000}/100000",GetPlayerScore(playerid));
}
if(GetPlayerScore(playerid) >= 100000 && <= 1000000)
{
format(Zscore, sizeof(Zscore), "Score: %d{FF0000}/1000000",GetPlayerScore(playerid));
}
return Zscore;
}
Huh... Friends I tried above stock because i need it.It compiles fine when I dont use it.But when I use it,it shows me following errors
pawn Код:
E:\X\SAMP\samp03x_svr_win32\gamemodes\ImpulsiveX.pwn(586) : warning 205: redundant code: constant expression is zero
E:\X\SAMP\samp03x_svr_win32\gamemodes\ImpulsiveX.pwn(590) : error 029: invalid expression, assumed zero
E:\X\SAMP\samp03x_svr_win32\gamemodes\ImpulsiveX.pwn(590) : warning 215: expression has no effect
E:\X\SAMP\samp03x_svr_win32\gamemodes\ImpulsiveX.pwn(590) : error 001: expected token: ";", but found ")"
E:\X\SAMP\samp03x_svr_win32\gamemodes\ImpulsiveX.pwn(590) : error 029: invalid expression, assumed zero
E:\X\SAMP\samp03x_svr_win32\gamemodes\ImpulsiveX.pwn(590) : 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.
I am using it in a Textdraw.
Re: How to? -
Dragonsaurus - 23.08.2013
pawn Код:
stock GetScore(playerid)
{
new Zscore[64];
if(GetPlayerScore(playerid) < 1000)
{
format(Zscore, sizeof(Zscore), "Score: %d{FF0000}/1000",GetPlayerScore(playerid));
}
if(1000 < GetPlayerScore(playerid) < 10000)
{
format(Zscore, sizeof(Zscore), "Score: %d{FF0000}/10000",GetPlayerScore(playerid));
}
if(10000 >= GetPlayerScore(playerid) <= 100000)
{
format(Zscore, sizeof(Zscore), "Score: %d{FF0000}/100000",GetPlayerScore(playerid));
}
if(100000 <= GetPlayerScore(playerid) <= 1000000)
{
format(Zscore, sizeof(Zscore), "Score: %d{FF0000}/1000000",GetPlayerScore(playerid));
}
return Zscore;
}