11.10.2015, 14:27
Quote:
[*]Different animation depending on weapon/bodypart, for example:
|
I'm sorry, i'm a total noob and seeing this huge wall of code isn't that encouraging...
[*]Different animation depending on weapon/bodypart, for example:
|
Well i put SKY in my server's "plugins" folder...
Also, i'm not sure why the include tab won't display anything under weapon-config. Anyway, i didn't really do anything with the include yet. I just put it in my includes folder, and since the other guy said it's on by default i just left it there. Do i have to make a filterscript with it? |
How can i customize death atnimations? I tryed to play an animation for a player under OnPlayerPrepareToDeath but it doesn't work.
|
public OnPlayerPrepareDeath(playerid, animlib[32], animname[32], &anim_lock, &respawn_time) {
//set the string contents
format(animlib, 32, "library");
format(animname, 32, "name");
anim_lock = 1;
respawn_time = 10000;
//rest of code
}
public OnPlayerPrepareDeath(playerid, animlib[32], animname[32], &anim_lock, &respawn_time) {
animlib = "lib";
animname = "anim";
}
[14:35:44] [debug] Run time error 4: "Array index out of bounds" [14:35:44] [debug] Accessing element at index 65535 past array upper bound 999 [14:35:44] [debug] AMX backtrace: [14:35:44] [debug] #0 0004b8a8 in public WC_OnPlayerDamage (&playerid=@0162e174 0, &Float:amount=@0162e178 4.95000, &issuerid=@0162e17c 65535, &weapon=@0162e180 54, &bodypart=@0162e184 3) at modulations/callbacks.pwn:315 [14:35:44] [debug] #1 00040264 in public OnPlayerDamage (&playerid=@0162e174 0, &Float:amount=@0162e178 4.95000, &issuerid=@0162e17c 65535, &weapon=@0162e180 54, &bodypart=@0162e184 3) at C:\Program Files (x86)\Pawno\include\weapon-config.inc:5232 [14:35:44] [debug] #2 000380fc in InflictDamage (playerid=0, Float:amount=4.95000, issuerid=65535, weaponid=54, bodypart=3) at C:\Program Files (x86)\Pawno\include\weapon-config.inc:4387 [14:35:44] [debug] #3 0002f834 in ?? (... <5 arguments>) at C:\Program Files (x86)\Pawno\include\weapon-config.inc:3244 [14:35:44] [debug] #4 00015fc4 in public OnPlayerTakeDamage (playerid=0, issuerid=65535, Float:amount=4.95000, weaponid=54, bodypart=3) at C:\Program Files (x86)\Pawno\include\YSI\y_hooks/impl.inc:2365
I found what seems to be a bug.
Code:
[14:35:44] [debug] Run time error 4: "Array index out of bounds" [14:35:44] [debug] Accessing element at index 65535 past array upper bound 999 [14:35:44] [debug] AMX backtrace: [14:35:44] [debug] #0 0004b8a8 in public WC_OnPlayerDamage (&playerid=@0162e174 0, &Float:amount=@0162e178 4.95000, &issuerid=@0162e17c 65535, &weapon=@0162e180 54, &bodypart=@0162e184 3) at modulations/callbacks.pwn:315 [14:35:44] [debug] #1 00040264 in public OnPlayerDamage (&playerid=@0162e174 0, &Float:amount=@0162e178 4.95000, &issuerid=@0162e17c 65535, &weapon=@0162e180 54, &bodypart=@0162e184 3) at C:\Program Files (x86)\Pawno\include\weapon-config.inc:5232 [14:35:44] [debug] #2 000380fc in InflictDamage (playerid=0, Float:amount=4.95000, issuerid=65535, weaponid=54, bodypart=3) at C:\Program Files (x86)\Pawno\include\weapon-config.inc:4387 [14:35:44] [debug] #3 0002f834 in ?? (... <5 arguments>) at C:\Program Files (x86)\Pawno\include\weapon-config.inc:3244 [14:35:44] [debug] #4 00015fc4 in public OnPlayerTakeDamage (playerid=0, issuerid=65535, Float:amount=4.95000, weaponid=54, bodypart=3) at C:\Program Files (x86)\Pawno\include\YSI\y_hooks/impl.inc:2365 |
Oh, I found the issue, and I did not have a check for INVALID_PLAYER_ID. Thank you, I completely forgot about that! One more thing I've run into is the class selection screen. It seems I go into player class selection if I die while inside a vehicle that explodes. I always respawn just fine, but if I'm in a vehicle for example, and another player hits me with an RPG (and the vehicle explodes, killing me), I'm sent to player class selection. Could this be potentially caused by my scripting? Thanks.
|
#define WC_DEBUG true
#include <weapon-config>