SA-MP Forums Archive
Crash Prob :/ - 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: Crash Prob :/ (/showthread.php?tid=553285)



Crash Prob :/ - killing - 29.12.2014

Код:
	if(pickupid == m4)
	{
		GivePlayerWeapon(playerid,31,500);
		SetPlayerHealth(playerid,100);
		SetPlayerPos(playerid, 30.1597,-3340.1558,540.3303);
		SendClientMessage(playerid,0x7CFC00AA,"Success: You have reached M4 You got");
        SendClientMessageToAll(COLOR_WHITE,"%s Has Reached M4");
		GivePlayerMoney(playerid, 250);
		PlayerInfo[playerid][pM4] ++;
		SetPlayerScore(playerid, GetPlayerScore(playerid)+3);
When some 1 reaches m4 he gets 3 score and +1 m4 in stats , but this is not working when some 1 reaches m4 server gets crashed


Respuesta: Crash Prob :/ - Zume - 29.12.2014

Use crashdetect, and check the variable.


Re: Crash Prob :/ - killing - 29.12.2014

Код:
[12:20:26] [debug] Server crashed while executing Fun.amx
[12:20:26] [debug] AMX backtrace:
[12:20:26] [debug] #0 native SendClientMessageToAll () from samp-server.exe
[12:20:26] [debug] #1 0002518c in public S@@_OnPlayerPickUpPickup (0, 1) from BaseJump2.amx
[12:20:26] [debug] #2 native CallLocalFunction () from samp-server.exe
[12:20:26] [debug] #3 00012bf4 in ?? (0, 1) from BaseJump2.amx
[12:20:26] [debug] #4 00000358 in public OnPlayerPickUpPickup (0, 1) from BaseJump2.amx
[12:20:27] [debug] Native backtrace:
[12:20:27] [debug] #0 004989ec in ?? () from samp-server.exe
[12:20:27] [debug] #1 2d0b84a6 in ?? () from samp-server.exe
[12:20:27] [debug] #2 698301e1 in ?? () from plugins\crashdetect.dll
[12:20:27] [debug] #3 77da6d0e in ?? () from C:\Windows\SYSTEM32\ntdll.dll
[12:20:27] [debug] #4 77da3470 in ?? () from C:\Windows\SYSTEM32\ntdll.dll
[12:20:27] [debug] #5 0048874e in ?? () from samp-server.exe



Re: Crash Prob :/ - Boot - 29.12.2014

Quote:

SendClientMessageToAll(COLOR_WHITE,"%s Has Reached M4");

^
Here is the problem.

You have to format the string (%s) before sending it to all players.