[Include] weapon-config.inc - Damage system with many features

This are the logs of sky.dll
PHP код:
1>------ Build startedProjectSKYConfigurationRelease Win32 ------
1>  BitStream.cpp
1
>  amxplugin.cpp
1
>  Addresses.cpp
1
>  amxfunctions.cpp
1
>  Functions.cpp
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(66): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(108): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(114): warning C4244'initializing'conversion from 'double' to 'float'possible loss of data
1
>  Hooks.cpp
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(66): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(108): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(114): warning C4244'initializing'conversion from 'double' to 'float'possible loss of data
1
>  main.cpp
1
>  RPCs.cpp
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(66): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(108): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(114): warning C4244'initializing'conversion from 'double' to 'float'possible loss of data
1
>  Scripting.cpp
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(66): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(108): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(114): warning C4244'initializing'conversion from 'double' to 'float'possible loss of data
1
>..\src\Scripting.cpp(448): warning C4267'initializing'conversion from 'size_t' to 'unsigned short'possible loss of data
1
>  Utils.cpp
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(66): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(108): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(114): warning C4244'initializing'conversion from 'double' to 'float'possible loss of data
1
>  subhook.c
1
>     Creating library C:\Users\gairo\Documents\Visual Studio 2015\Projects\SKY\Release\SKY.lib and object C:\Users\gairo\Documents\Visual Studio 2015\Projects\SKY\Release\SKY.exp
1
>  Generating code
1
>  Finished generating code
1
>  SKY.vcxproj -> C:\Users\gairo\Documents\Visual Studio 2015\Projects\SKY\Release\SKY.dll
1
>  SKY.vcxproj -> C:\Users\gairo\Documents\Visual Studio 2015\Projects\SKY\Release\SKY.pdb (Full PDB)
========== 
Build1 succeeded0 failed0 up-to-date0 skipped ========== 
compiled it on visual studio 2015, and yes it is upgraded to be compiled to vs 2015
it is working but I don't know if it is optimal.

1.) I don't understand anything of this at all.
2.) I don't know how to make a plugin, but I can edit it if told what to edit
3.) I already have other compiled .dll of sky, but it is broken for me that is why I compiled my own.
4.) If anyone wants a copy of the dll just tell me, they can either pm me, or follow a post below this. I'll give the link
5.) I don't know if it's broken. but it's working so it's not but maybe just bugged because I used a latter compiler

NOTE: I haven't read the logs yet, I want to first post the logs to ask if the it is in optimal shape.

Second thing is that I recompiled it again, but this time baring no logs at all,
I think because it converted the .dll

EDIT:
Quote:
Originally Posted by X337
Посмотреть сообщение
I got a problem when a player death in a vehicle, the player spawned in blueberry / default spawn location after died and also spawned with a bottle / cigarette in their hand.
Does everyone else facing this issue?
It seems the problem is only when i host the gamemode, because it doesn't appear while i'm testing it on local.
I assume you are using windows on local and linux on hosting?

Trying to understand how to compile on linux. Might be able to fix problems
Reply

Quote:
Originally Posted by JesterlJoker
Посмотреть сообщение
This are the logs of sky.dll
PHP код:
1>------ Build startedProjectSKYConfigurationRelease Win32 ------
1>  BitStream.cpp
1
>  amxplugin.cpp
1
>  Addresses.cpp
1
>  amxfunctions.cpp
1
>  Functions.cpp
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(66): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(108): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(114): warning C4244'initializing'conversion from 'double' to 'float'possible loss of data
1
>  Hooks.cpp
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(66): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(108): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(114): warning C4244'initializing'conversion from 'double' to 'float'possible loss of data
1
>  main.cpp
1
>  RPCs.cpp
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(66): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(108): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(114): warning C4244'initializing'conversion from 'double' to 'float'possible loss of data
1
>  Scripting.cpp
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(66): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(108): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(114): warning C4244'initializing'conversion from 'double' to 'float'possible loss of data
1
>..\src\Scripting.cpp(448): warning C4267'initializing'conversion from 'size_t' to 'unsigned short'possible loss of data
1
>  Utils.cpp
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(66): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(108): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(114): warning C4244'initializing'conversion from 'double' to 'float'possible loss of data
1
>  subhook.c
1
>     Creating library C:\Users\gairo\Documents\Visual Studio 2015\Projects\SKY\Release\SKY.lib and object C:\Users\gairo\Documents\Visual Studio 2015\Projects\SKY\Release\SKY.exp
1
>  Generating code
1
>  Finished generating code
1
>  SKY.vcxproj -> C:\Users\gairo\Documents\Visual Studio 2015\Projects\SKY\Release\SKY.dll
1
>  SKY.vcxproj -> C:\Users\gairo\Documents\Visual Studio 2015\Projects\SKY\Release\SKY.pdb (Full PDB)
========== 
Build1 succeeded0 failed0 up-to-date0 skipped ========== 
compiled it on visual studio 2015, and yes it is upgraded to be compiled to vs 2015
it is working but I don't know if it is optimal.

1.) I don't understand anything of this at all.
2.) I don't know how to make a plugin, but I can edit it if told what to edit
3.) I already have other compiled .dll of sky, but it is broken for me that is why I compiled my own.
4.) If anyone wants a copy of the dll just tell me, they can either pm me, or follow a post below this. I'll give the link
5.) I don't know if it's broken. but it's working so it's not but maybe just bugged because I used a latter compiler

NOTE: I haven't read the logs yet, I want to first post the logs to ask if the it is in optimal shape.

Second thing is that I recompiled it again, but this time baring no logs at all,
I think because it converted the .dll

EDIT:


I assume you are using windows on local and linux on hosting?

Trying to understand how to compile on linux. Might be able to fix problems
I have the same for my build on Windows from a couple months ago.
https://mirror.jeroendeneef.com/samp...indows/SKY.dll

Building for Linux is also fairly simple.
Reply

Quote:
Originally Posted by X337
Посмотреть сообщение
I got a problem when a player death in a vehicle, the player spawned in blueberry / default spawn location after died and also spawned with a bottle / cigarette in their hand.
Does everyone else facing this issue?
It seems the problem is only when i host the gamemode, because it doesn't appear while i'm testing it on local.
For anyone facing issue like i explained above, there's a way to fix this by toggling spectate mode (TogglePlayerSpectating) right after a player death in a vehicle.
Reply

Hello, how to remove the textdraw and take into account only real health while using the include please ?
Reply

Quote:
Originally Posted by 357
Посмотреть сообщение
Hello, how to remove the textdraw and take into account only real health while using the include please ?
If I think what you're implying, it means that you want to remove an important part of this include.

You can't really display "real health" due to the following situation.
If their "real health" is 1.0, and you shoot at them, but you want to decline the damage, the player still dies.
Whenever a player "dies" in weapon-config, they just play the animation and execute certain other functions to mimmick death by respawning or setting to spectating, in reality they still have health way over a couple hundred.
Reply

Quote:
Originally Posted by JesterlJoker
Посмотреть сообщение
This are the logs of sky.dll
PHP код:
1>------ Build startedProjectSKYConfigurationRelease Win32 ------
1>  BitStream.cpp
1
>  amxplugin.cpp
1
>  Addresses.cpp
1
>  amxfunctions.cpp
1
>  Functions.cpp
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(66): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(108): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(114): warning C4244'initializing'conversion from 'double' to 'float'possible loss of data
1
>  Hooks.cpp
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(66): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(108): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(114): warning C4244'initializing'conversion from 'double' to 'float'possible loss of data
1
>  main.cpp
1
>  RPCs.cpp
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(66): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(108): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(114): warning C4244'initializing'conversion from 'double' to 'float'possible loss of data
1
>  Scripting.cpp
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(66): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(108): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(114): warning C4244'initializing'conversion from 'double' to 'float'possible loss of data
1
>..\src\Scripting.cpp(448): warning C4267'initializing'conversion from 'size_t' to 'unsigned short'possible loss of data
1
>  Utils.cpp
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(66): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(108): warning C4244'return'conversion from 'double' to 'float'possible loss of data
1
>c:\users\gairo\documents\visual studio 2015\projects\sky\src\CVector.h(114): warning C4244'initializing'conversion from 'double' to 'float'possible loss of data
1
>  subhook.c
1
>     Creating library C:\Users\gairo\Documents\Visual Studio 2015\Projects\SKY\Release\SKY.lib and object C:\Users\gairo\Documents\Visual Studio 2015\Projects\SKY\Release\SKY.exp
1
>  Generating code
1
>  Finished generating code
1
>  SKY.vcxproj -> C:\Users\gairo\Documents\Visual Studio 2015\Projects\SKY\Release\SKY.dll
1
>  SKY.vcxproj -> C:\Users\gairo\Documents\Visual Studio 2015\Projects\SKY\Release\SKY.pdb (Full PDB)
========== 
Build1 succeeded0 failed0 up-to-date0 skipped ========== 
Its because your using a VS2015 and it was originally created on a lower toolkit, meaning an older version of the C++ compiler that VS uses.

Its not a very hard fix, if you just ****** it, you could learn how to fix it in 2 mins.

Also, it has no effect on the actual plugin. I tested it, you can either fix it, or ignore it. They are only warnings and they don't cause any issues as far as I can see.
Reply

When I put the include in my gamemode it does this when I start the server.
How to repair this please ?
Код:
[17:41:36] 
[17:41:36] Filterscripts
[17:41:36] ---------------
[17:41:36]   Loaded 0 filterscripts.

[17:41:36] Script[gamemodes/GM.amx]: Run time error 19: "File or function is not found"
[17:41:36] Number of vehicle models: 0
Reply

Quote:
Originally Posted by 357
Посмотреть сообщение
When I put the include in my gamemode it does this when I start the server.
How to repair this please ?
Код:
[17:41:36] 
[17:41:36] Filterscripts
[17:41:36] ---------------
[17:41:36]   Loaded 0 filterscripts.

[17:41:36] Script[gamemodes/GM.amx]: Run time error 19: "File or function is not found"
[17:41:36] Number of vehicle models: 0
weapon-config requires SKY plugin.
Get it here: https://sampforum.blast.hk/showthread.php?tid=563442
Reply

hi
why after connect I have now not spent health in the fall ?
and the character also doesn't die under water
Reply

Quote:
Originally Posted by f0Re3t
Посмотреть сообщение
hi
why after connect I have now not spent health in the fall ?
and the character also doesn't die under water
What is your OnPlayerDamage?
And do you have SetCustomFallDamage set to something? If you do try to comment it out and test it again.
Reply

here is my OnPlayerDamage
Quote:

public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart)
{
if(IsPlayerPaused(issuerid)) return 0;
return 1;
}

SetCustomFallDamage do not use but have tried to use - everything is exactly the same
Reply

Thank you for this include!
Reply

Is there any way I can enable Cbug for certain players?
Reply

Quote:
Originally Posted by Kalgon
Посмотреть сообщение
Is there any way I can enable Cbug for certain players?
You'll have to edit the include.
Reply

Quote:
Originally Posted by Kalgon
Посмотреть сообщение
Is there any way I can enable Cbug for certain players?
Like renatog said, you would need to make the CbugAllowed (IIRC) variable per-player and then add a playerid param to the toggling function. This would only take a few seconds to do and I would help but I can't right now.
Reply

Quote:
Originally Posted by Crayder
Посмотреть сообщение
Like renatog said, you would need to make the CbugAllowed (IIRC) variable per-player and then add a playerid param to the toggling function. This would only take a few seconds to do and I would help but I can't right now.
Anyone who could tell me how this could be done or link me a relevant tutorial? I don't have much experience with editing includes.
Reply

Quote:
Originally Posted by Kalgon
Посмотреть сообщение
Anyone who could tell me how this could be done or link me a relevant tutorial? I don't have much experience with editing includes.
You don't need to edit the include, you could do something like this in OnPlayerDamage.

pawn Код:
new avg_rate = AverageShootRate(issuerid, 2);

        // Lower rapid fire damage
        if (avg_rate != -1 && !pInfo[issuerid][cbug]) {
            if (weapon == WEAPON_DEAGLE && avg_rate < 500) {
                amount *= 0.50;
            } else if (weapon == WEAPON_SHOTGSPA && avg_rate < 250) {
                amount *= 0.50;
            }
        }
Reply

Sometimes players can not deal damage to enemy vehicles for some reason. When I enable passenger damage and the player goes to the passenger seat, damage is done, also if we enable unoccupied vehicle damage it is also working. However when it comes to damaging an enemy vehicle that has a driver in it, the damage is not done.

I had to add a damage feature manually myself to the include and when I do this, I needed to add a check for teammates so that people can not damage their teammate's vehicle. The tricky part starts now. Without adding adding a teammate checker, regardless of having EnableVehicleFriendlyFire() teammates can deal damage with guns. When I added the team checker, I can not deal damage to my teammates however when I deal damage to an enemy vehicle, the health flickers (it goes up and then it goes down very quickly) the damage is done, but the health on /dl flickers. When weaponc-config is not included, these issues do not occur. I tried the debug mode and the shots on the vehicle are not rejected shots, the script does detect them.

Also, there is a runtime error which occurs when a player is hurt by client-sided fires (the ones generated after vehicle explosions etc.) array index is out of bounds, the value for the issuerid turns out to be INVALID_PLAYER_ID and this causes a bunch of runtime errors. Which also prevents the player from getting damaged, as well.
Reply

Latest update: 11 Sep 2016
Someone update this include ?
Reply

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
Latest update: 11 Sep 2016
Someone update this include ?
Since the pull requests are not getting merged I am assuming that the project owner does not have time to work on the project.

What you could do is fork the project and make changes yourself and submit a pull request.

And I don't believe that this include needs to be updated, however it getting actively maintained and developed would be preferred. I'm sure you meant to say "Someone maintain this include."
Reply


Forum Jump:


Users browsing this thread: 26 Guest(s)