Posts: 125
Threads: 34
Joined: Apr 2010
Reputation:
0
try and do
new pt;
new string[4];
format(string,sizeof(string), "You have earned %s GP.", pt);
SendClientMessage(playerid, COLOR_GREEN, string);
It could have been because of the UnderScore "_"
That could be one problem, but I just thought of the most possible one.
When are the players points being given?
What function gives the player points?
Is it the players score?
If it is, delete new game_pt; or new pt;
And do
new game_pt = PlayerPointFunction;
And replace that with your fuction that gives the player points
I am not a Pro, I am still learning.
I am tired so I don't know if this will help or if it makes sense xD.
But if it helps at all, well GoodLuck with your script.
_*Unrelated*_
Whats the Maximum Points you can get?
9999?
If it can get higher, you could change the 4 in new string[4]; to new string[10];
Thats nothing to do with the crash, but just so the string fully displays.
Posts: 6,340
Threads: 58
Joined: May 2009
Reputation:
0
Add ; at the end of the game_pt variable, and %s is for formatting strings, correct would be %i or %d, but game_pt will always show 0 at this code.
Also, 4 cells in string array isn't enough to format that message.
Posts: 1,363
Threads: 14
Joined: Apr 2009
Reputation:
0
if it doesn't then use
new game_pt = 0;
if anything would crash it in that code it'd probably be the fact that you're trying to put variable worth nothing into a string