Passing color code - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Passing color code (
/showthread.php?tid=200527)
SetTimerEx = Server Crash -
*IsBack - 18.12.2010
Hi,
I got this code:
pawn Код:
public SendServerMessage(playerid, color, text[])
{
if(Wait[playerid] == 1)
{
SetTimerEx("SendServerMessage",WaitTime+50,0,"dss",playerid,color,text);
return 1;
}
//...
}
But it crashes the server... More info:
http://forum.sa-mp.com/showpost.php?...09&postcount=5
Re: Passing color code -
JaTochNietDan - 18.12.2010
It's working fine for me, what type of variable are you using for "WaitTime"?
Re: Passing color code -
*IsBack - 18.12.2010
Quote:
Originally Posted by JaTochNietDan
It's working fine for me, what type of variable are you using for "WaitTime"?
|
It's on top of my script:
#define WaitTime 500
Re: Passing color code -
JaTochNietDan - 18.12.2010
Strange, I don't get any errors on that line using the same code as you!
Re: Passing color code -
*IsBack - 18.12.2010
Quote:
Originally Posted by JaTochNietDan
Strange, I don't get any errors on that line using the same code as you!
|
Oh wait.. My bad.. I don't get error anymore, but the server crashes just when it starts..
If I comment that line, everything works..
crashinfo:
Quote:
--------------------------
SA-MP Server: 0.3c RC4
Exception At Address: 0x00406A28
Registers:
EAX: 0x00000000 EBX: 0x00003564 ECX: 0x00000000 EDX: 0x00000000
ESI: 0x0317437C EDI: 0x00000000 EBP: 0x0139CC00 ESP: 0x0012FD84
EFLAGS: 0x00010246
Stack:
+0000: 0x0139CC00 0x030FF780 0x030C55AC 0x00000000
+0010: 0x03102CE4 0x00000000 0x00402C20 0x0139CC00
+0020: 0x00000000 0x0294EA20 0x00000003 0x00000003
+0030: 0x0139CC00 0x00003564 0x0000317C 0x00074BFC
+0040: 0x00074C2C 0x00070C30 0x00074C14 0x00070C30
+0050: 0x030C1C14 0x030FF780 0x656E6E6F 0x030C0020
+0060: 0x0003DB6C 0x00490ABA 0x0139CC00 0x0012FE18
+0070: 0x00000052 0x01448E98 0x760FEF66 0x3BA40330
+0080: 0x014482E0 0x0294EA20 0x00000052 0x014482E0
+0090: 0x0294EA40 0x000001F4 0x0049B864 0x00000005
+00A0: 0x760FEFA0 0x760FF292 0x00000000 0x3BA40330
+00B0: 0x004980CC 0x00000000 0x00001DB0 0x0012FF88
+00C0: 0x7FFD5000 0x00015000 0x00010101 0x00000078
+00D0: 0x00001F55 0x00000078 0x000018D4 0x01448E98
+00E0: 0x656D6167 0x65646F6D 0x00003531 0x004CA014
+00F0: 0x004CA010 0x7FFD5000 0x004B4B90 0x0012FE70
+0100: 0x0012FE68 0x0012FF78 0x004A6AC4 0x004C1378
+0110: 0xFFFFFFFF 0x004A4D81 0x004A4D91 0x004B4B90
+0120: 0x0012FF78 0x004B4811 0xFFFFFFFF 0x004A6562
+0130: 0x00000001 0x014414A8 0x014414E8 0x00000094
|
Re: Passing color code -
Mean - 18.12.2010
Works fine for me too.
Re: Passing color code -
Benjo - 18.12.2010
You are passing the color variable as a string in the timer. Change it to an integer/decimal:
pawn Код:
SetTimerEx("SendServerMessage",WaitTime+50,0,"dds",playerid,color,text); // dds instead of dss
This would explain why it compiles fine, but then crashes when it tries to give your color parameter a string value.
Re: Passing color code -
*IsBack - 18.12.2010
Quote:
Originally Posted by Benjo
You are passing the color variable as a string in the timer. Change it to an integer/decimal:
pawn Код:
SetTimerEx("SendServerMessage",WaitTime+50,0,"dds",playerid,color,text); // dds instead of dss
This would explain why it compiles fine, but then crashes when it tries to give your color parameter a string value.
|
Tried that, still crashes..
Re: Passing color code -
*IsBack - 19.12.2010
Still waiting for a solution.. :S
Re: Passing color code -
Ash. - 19.12.2010
This might be a long shot, but if you are using 0.3c (RC's) make sure you have the latest includes.
And back to Benjo's point, surely the colour variable should be passed as a hexadecimal? (Format as: x)