Re: weapon-config.inc - Damage system with many features -
Greggu - 11.10.2015
Quote:
Originally Posted by Slice
[*]Different animation depending on weapon/bodypart, for example: - Headshots make you fall back with both hands in your face
- Shotgun kills make you fly backward like in GTA:VC (unless killed from behind)
|
And how exactly do we do that?
I'm sorry, i'm a total noob and seeing this huge wall of code isn't that encouraging...
Re: weapon-config.inc - Damage system with many features -
Jeroen52 - 11.10.2015
Quote:
Originally Posted by Greggu
And how exactly do we do that?
I'm sorry, i'm a total noob and seeing this huge wall of code isn't that encouraging...
|
It is enabled by default.
Re: weapon-config.inc - Damage system with many features -
Greggu - 11.10.2015
Quote:
Originally Posted by Jeroen52
It is enabled by default.
|
I just tested it on my server and when it kills someone it will just display the default animation.
Do i have to compile something in the include as a filterscript?
Re: weapon-config.inc - Damage system with many features -
Slice - 11.10.2015
Did you install SKY?
Post your server log.
Re: weapon-config.inc - Damage system with many features -
Greggu - 11.10.2015
Quote:
Originally Posted by Slice
Did you install SKY?
Post your server log.
|
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?
Re: weapon-config.inc - Damage system with many features -
Jeroen52 - 11.10.2015
Quote:
Originally Posted by Greggu
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?
|
No, you include the include in your gamemode.
Re: weapon-config.inc - Damage system with many features -
ExTaZZ69 - 11.10.2015
Quote:
Originally Posted by Slice
Try removing some plugins (nativechecker, itd, geoip) to see if they are interfering with SKY.
Did you compile SKY yourself or download it?
|
I think the nativechecker causes these errors. The problem with the damage was in my script.
Re: weapon-config.inc - Damage system with many features -
RogerCosta - 11.10.2015
Quote:
Originally Posted by SecretBoss
What plugins are required to use this include? Because I compiled my script and it printed gamemode as Unknown
|
Only SKY plugin.
Re: weapon-config.inc - Damage system with many features -
ExTaZZ69 - 13.10.2015
How can i customize death atnimations? I tryed to play an animation for a player under OnPlayerPrepareToDeath but it doesn't work.
Re: weapon-config.inc - Damage system with many features -
Crayder - 13.10.2015
Quote:
Originally Posted by ExTaZZ69
How can i customize death atnimations? I tryed to play an animation for a player under OnPlayerPrepareToDeath but it doesn't work.
|
pawn Code:
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
}
Re: weapon-config.inc - Damage system with many features -
ExTaZZ69 - 13.10.2015
Quote:
Originally Posted by Crayder
pawn Code:
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 }
|
Thanks, Crayder!
Re: weapon-config.inc - Damage system with many features -
Slice - 13.10.2015
Could just do:
pawn Code:
public OnPlayerPrepareDeath(playerid, animlib[32], animname[32], &anim_lock, &respawn_time) {
animlib = "lib";
animname = "anim";
}
No need to use string copy functions when the array size is known. And format should never be used to copy strings.
Re: weapon-config.inc - Damage system with many features -
Crayder - 14.10.2015
Quote:
Originally Posted by Slice
No need to use string copy functions when the array size is known. And format should never be used to copy strings.
|
Yes, I know that. It was just a very quick example that I had off the top of my head.
Re: weapon-config.inc - Damage system with many features -
MartinSwag - 25.10.2015
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
The above errors are what appeared in console after a player was hit by heli-blades, thrown and landed. The damage they took from landing caused those. I return 0'd to prevent heliblade damage, but for some reason, the damage a player takes after being thrown makes that happen.
Re: weapon-config.inc - Damage system with many features -
Crayder - 25.10.2015
Quote:
Originally Posted by MartinSwag
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
The above errors are what appeared in console after a player was hit by heli-blades, thrown and landed. The damage they took from landing caused those. I return 0'd to prevent heliblade damage, but for some reason, the damage a player takes after being thrown makes that happen.
|
Looks like the 'bug' is in YOUR script. You're probably trying to use `issuerid` somewhere it shouldn't be used, most likely a 'MAX_PLAYERS' array. Validate the ID before using it.
Re: weapon-config.inc - Damage system with many features -
MartinSwag - 26.10.2015
Quote:
Originally Posted by Crayder
Looks like the 'bug' is in YOUR script. You're probably trying to use `issuerid` somewhere it shouldn't be used, most likely a 'MAX_PLAYERS' array. Validate the ID before using it.
|
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.
Re: weapon-config.inc - Damage system with many features -
Crayder - 26.10.2015
Quote:
Originally Posted by MartinSwag
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.
|
That is done on purpose. Vehicle explosion deaths are impossible to prevent, so as an alternative to doing so players are sent to class selection.
EDIT: Actually in the latest versions it is skipped.
Re: weapon-config.inc - Damage system with many features -
Slice - 27.10.2015
What crayder said applies for older versions. It should work without problems, but you may be doing something to cause it.
Do you use ForceClassSelection?
Do you use OnPlayerRequestClass in a filterscript?
Re: weapon-config.inc - Damage system with many features -
MartinSwag - 27.10.2015
Quote:
Originally Posted by Slice
What crayder said applies for older versions. It should work without problems, but you may be doing something to cause it.
Do you use ForceClassSelection?
Do you use OnPlayerRequestClass in a filterscript?
|
That is odd, I don't force class selection, nor do I have any callbacks for it in my filterscript (only using Simon's debug). I tried loading up the default grand larceny server, and the issue didn't occur. The only thing I can think of that may be causing this is my login and registration system. I use SetSpawnInfo and SpawnPlayer afer they login/register. Could this be causing the issue?
Re: weapon-config.inc - Damage system with many features -
Slice - 28.10.2015
Enable debug and show me the output.
pawn Code:
#define WC_DEBUG true
#include <weapon-config>