14.09.2017, 02:05
Hey, I'm having this issue. I created a cmd to kill myself. It does the work, but kinda returns 0 ingame and displays errors in the server. I have them both with SKY.dll from somewhere and one I just compiled on Windows 10.
This is the error:
And this is the code:
Thanks in advance.
This is the error:
Код:
[connection] 127.0.0.1:53763 requests connection cookie. [connection] incoming connection: 127.0.0.1:53763 id: 0 [join] poxer has joined the server (0:127.0.0.1) [debug] Run time error 4: "Array index out of bounds" [debug] Attempted to read/write array element at index 65535 in array of size 1000 [debug] AMX backtrace: [debug] #0 0002a238 in public WC_OnPlayerDeath (playerid=0, killerid=65535, reason=55) at poxeru2.pwn:395 [debug] #1 00018f84 in InflictDamage (playerid=0, Float:amount=0.00000, issuerid=65535, weaponid=55, bodypart=0, bool:ignore_armour=false) at C:\Program Files (x86)\Pawno\include\weapon-config.inc:4762 [debug] #2 000015a0 in WC_SetPlayerHealth (playerid=0, Float:health=0.00000, Float:armour=-1.00000) at C:\Program Files (x86)\Pawno\include\weapon-config.inc:1383 [debug] #3 0002b40c in public cmd_kill (playerid=0, params[]=@006051d0 "") at poxeru2.pwn:545 [debug] #4 native CallLocalFunction () from samp-server.exe [debug] #5 0001fb48 in public OnPlayerCommandText (playerid=0, cmdtext[]=@006051b8 "/kill") at C:\Program Files (x86)\Pawno\include\zcmd.inc:102
Код:
CMD:kill(playerid, params[]) { if(IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid, 0xFF0000FF, "You can't use this command while in a vehicle!"); } else { SetPlayerHealth(playerid, 0.0); PlayerPlaySound(playerid, 1190, 0.0, 0.0, 0.0); } return 1; }