SA-MP Forums Archive
I need some 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: I need some help: (/showthread.php?tid=298267)



I need some help: - nogh445 - 20.11.2011

Код:
39:  |forward SetScore();
40:  |public SetScore()
41:  |{
42:  |for(new i=0;i<MAX_PLAYERS;i++)
43:  |  {
44:  |      Score[i]=GetPlayerMoney(i);
45:  |      SetPlayerScore(i, Score[i]);
46:  |  }
47:  |  return 1;
48:  |}
49:  |myfunc()
50:  |{
51:  |  return 1;
52:  |}
^^^This is after main()^^^

Pawno Errors:
Код:
C:\Users\user\Desktop\SAMP SERVER STUFF\samp server\pawno\new.pwn(44) : error 017: undefined symbol "Score"
C:\Users\user\Desktop\SAMP SERVER STUFF\samp server\pawno\new.pwn(44) : warning 215: expression has no effect
C:\Users\user\Desktop\SAMP SERVER STUFF\samp server\pawno\new.pwn(44) : error 001: expected token: ";", but found "]"
C:\Users\user\Desktop\SAMP SERVER STUFF\samp server\pawno\new.pwn(44) : error 029: invalid expression, assumed zero
C:\Users\user\Desktop\SAMP SERVER STUFF\samp server\pawno\new.pwn(44) : fatal error 107: too many error messages on one line



Re: I need some help: - MP2 - 20.11.2011

forward SetScore();

Put that just before the public.


Re: I need some help: - nogh445 - 20.11.2011

That got the line 40 error message away. I still have that^^^^


Re: I need some help: - [GOD]Dragonster82 - 20.11.2011

Define the score.

#Define


Re: I need some help: - MP2 - 20.11.2011

Why have a timer for this? Just set their cash and score at the same time.


Re: I need some help: - nogh445 - 20.11.2011

defining it did not do anything


Re: I need some help: - nogh445 - 20.11.2011

Quote:
Originally Posted by MP2
Посмотреть сообщение
Why have a timer for this? Just set their cash and score at the same time.
Could you show me how?


Re: I need some help: - nogh445 - 20.11.2011

I'v messed around a bit and this is what i have now:
Код:
40:  |public SetScore()
41:  |{
42:  |	{
43:  |      SetPlayerScore(playerid, 5);
44:  |	}
45:  |	return 1;
46:  |}
Error:

Код:
C:\Users\user\Desktop\SAMP SERVER STUFF\samp server\pawno\new.pwn(43) : error 017: undefined symbol "playerid"



Re: I need some help: - MP2 - 20.11.2011

Why do you want their score to be the same as their cash?


Re: I need some help: - Sinc - 20.11.2011

Quote:
Originally Posted by [GOD]Dragonster82
Посмотреть сообщение
Define the score.

#Define
Macros aren't arrays, you simply define the name and declare a constant.

Код:
error 017: undefined symbol "Score"
The compiler's is unaware of what 'Score' is, therefore you will receive that it is undefined. I'm assuming since it is a looping instruction given that some functions will apply, you must initialize 'Score' as MAX_PLAYERS.

pawn Код:
new Score[MAX_PLAYERS];
Declare this globally, outside of any functions or callbacks.