Highest Damage Point that can be given out by weapon (that supports skills)
#1

I have been doing an experiment lately as a friend of mine informed me that he can manipulate the weapon, Instead of having that plain slow weapon hitman skill, He instead uses a CLEO to manipulate the weapon making his weapon double (having the highest weapon skill). This gives me an idea to check the highest damages given out by these weapons which supports hitman skill.

I don't know if it would be helpful but I am placing down the results I have done via the NPC.

Note: No matter what where I shoot at the bodypart, the damage given to the player will be always the same unless you missed the part a little bit (or if you are in a far distance)

WeaponFirst Result (Damage)Final Result (Damage)
M49.9000 (no skill)9.9000 (w/ skill)
AK479.9000 (no skill)9.9000 (w/ skill)
Colt 45 (9mm)8.2500 (no skill)8.2500 (w/ skill)
Desert Eagle23.1000 (no skill)46.2000 (w/ 200+ skill)
Shotgun49.5000 (no skill)49.5000 (w/ skill)
Sawnoff49.5000 (no skill)49.5000 (w/ skill)
Combat Shotgun39.6000 (no skill)39.6000 (w/ skill)
MP58.2500 (no skill)8.2500 (w/ skill)
UZI/TEC96.6000 (no skill)6.6000 (w/ skill)
Sniper Rifle41.2500 (no skill)41.2500 (w/ skill)
Assault Rifle24.7500 (no skill)24.7500 (w/ skill)
* So far, only Desert Eagle has a damage point changes once the player hits the 200% hitman skill (SetPlayerWeaponSkill)

This is what I used on testing;

PHP Code:
#include <a_samp>
#include <zcmd>
#include <sscanf2>
new skillsPlayer[MAX_PLAYERS][13];
new const 
g_aWeaponSlots[] = {
    
001111111110101010101088800022233344554667777812999111111
};
main()
{
    print(
"* Test Maps Gamemode");
}
public 
OnGameModeInit()
{
    
SendRconCommand("hostname Test Maps Here - Ronald Lacson");
    
SetGameModeText("Test Gamemode");
    
AddPlayerClass(01958.37831343.157215.3746269.1425000000);
    
ConnectNPC("MyBitch""npcidle");
    return 
1;
}
public 
OnGameModeExit()
{
    return 
1;
}
public 
OnPlayerRequestClass(playeridclassid)
{
    if(
IsPlayerNPC(playerid))
    {
        
SetSpawnInfo(playerid255299, -1972.5763137.897427.687586.3663000000);
        
SpawnPlayer(playerid);
    }
    
SetPlayerPos(playerid1958.37831343.157215.3746);
    
SetPlayerCameraPos(playerid1958.37831343.157215.3746);
    
SetPlayerCameraLookAt(playerid1958.37831343.157215.3746);
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    for(new 
i13i++)
    {
        
skillsPlayer[playerid][i] = 0;
    }
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    
SetPlayerSkillLevel(playeridWEAPONSKILL_M40);
    
SetPlayerSkillLevel(playeridWEAPONSKILL_AK470);
    
SetPlayerSkillLevel(playeridWEAPONSKILL_PISTOL0);
    
SetPlayerSkillLevel(playeridWEAPONSKILL_DESERT_EAGLE0);
    
SetPlayerSkillLevel(playeridWEAPONSKILL_SHOTGUN0);
    
SetPlayerSkillLevel(playeridWEAPONSKILL_SAWNOFF_SHOTGUN0);
    
SetPlayerSkillLevel(playeridWEAPONSKILL_SPAS12_SHOTGUN0);
    
SetPlayerSkillLevel(playeridWEAPONSKILL_MICRO_UZI0);
    
SetPlayerSkillLevel(playeridWEAPONSKILL_MP50);
    
SetPlayerSkillLevel(playeridWEAPONSKILL_SNIPERRIFLE0);
    if(
IsPlayerNPC(playerid))
    {
        
SetPlayerPos(playerid1958.37831343.157215.3746);
        
SetPlayerFacingAngle(playerid269.1425);
        
SetPlayerInterior(playerid0);
        
SetPlayerVirtualWorld(playerid0);
        
SetPlayerSkin(playerid192);
        return 
1;
    }
    return 
1;
}
CMD:giveskills(playeridparams[])
{
    new 
skillgun[32], str[128];
    if(
sscanf(params"ds[32]"skillgun))
        return 
SendClientMessage(playerid, -1"What gun skill doe and how percent. (m4/ak47/9mm/deagle/shotgun/sawnoff/spas/uzi/mp5/sniper)");
    if(
skill || skill 1000)
        return 
SendClientMessage(playerid, -1"What gun skill doe and how percent. (m4/ak47/9mm/deagle/shotgun/sawnoff/spas/uzi/mp5/sniper)");
    
format(strsizeof(str), "* You have set the percent of the skill for the weapon to %d%%"skill);
    
SendClientMessage(playerid0x33AA33FFstr);
    if(
strcmp(gun"m4"true) == 0)
    {
        
skillsPlayer[playerid][5] = skill;
        
SetPlayerSkillLevel(playeridWEAPONSKILL_M4skill);
        
SendClientMessage(playerid, -1"* You received an M4 skill.");
    }
    else if(
strcmp(gun"ak47"true) == 0)
    {
        
skillsPlayer[playerid][5] = skill;
        
SetPlayerSkillLevel(playeridWEAPONSKILL_AK47skill);
        
SendClientMessage(playerid, -1"* You received an AK47 skill.");
    }
    else if(
strcmp(gun"9mm"true) == 0)
    {
        
skillsPlayer[playerid][2] = skill;
        
SetPlayerSkillLevel(playeridWEAPONSKILL_PISTOLskill);
        
SendClientMessage(playerid, -1"* You received a 9mm skill.");
    }
    else if(
strcmp(gun"deagle"true) == 0)
    {
        
skillsPlayer[playerid][2] = skill;
        
SetPlayerSkillLevel(playeridWEAPONSKILL_DESERT_EAGLEskill);
        
SendClientMessage(playerid, -1"* You received a Deagle skill.");
    }
    else if(
strcmp(gun"shotgun"true) == 0)
    {
        
skillsPlayer[playerid][3] = skill;
        
SetPlayerSkillLevel(playeridWEAPONSKILL_SHOTGUNskill);
        
SendClientMessage(playerid, -1"* You received a Shotgun skill.");
    }
    else if(
strcmp(gun"sawnoff"true) == 0)
    {
        
skillsPlayer[playerid][3] = skill;
        
SetPlayerSkillLevel(playeridWEAPONSKILL_SAWNOFF_SHOTGUNskill);
        
SendClientMessage(playerid, -1"* You received a Sawn Off skill.");
    }
    else if(
strcmp(gun"spas"true) == 0)
    {
        
skillsPlayer[playerid][3] = skill;
        
SetPlayerSkillLevel(playeridWEAPONSKILL_SPAS12_SHOTGUNskill);
        
SendClientMessage(playerid, -1"* You received a Spa skill.");
    }
    else if(
strcmp(gun"uzi"true) == 0)
    {
        
skillsPlayer[playerid][4] = skill;
        
SetPlayerSkillLevel(playeridWEAPONSKILL_MICRO_UZIskill);
        
SendClientMessage(playerid, -1"* You received an Uzi skill.");
    }
    else if(
strcmp(gun"mp5"true) == 0)
    {
        
skillsPlayer[playerid][4] = skill;
        
SetPlayerSkillLevel(playeridWEAPONSKILL_MP5skill);
        
SendClientMessage(playerid, -1"* You received an MP5 skill.");
    }
    else if(
strcmp(gun"sniper"true) == 0)
    {
        
skillsPlayer[playerid][6] = skill;
        
SetPlayerSkillLevel(playeridWEAPONSKILL_SNIPERRIFLEskill);
        
SendClientMessage(playerid, -1"* You received a Sniper Rifle skill.");
    }
    return 
1;
}
CMD:givegun(playeridparams[])
{
    if(
isnull(params))
        return 
SendClientMessage(playerid, -1"What gun doe. (m4/ak47/9mm/deagle/shotgun/sawnoff/spas/uzi/mp5/sniper/rifle/tec9)");
        
    if(
strcmp(params"m4"true) == 0)
    {
        
GivePlayerWeapon(playerid31999999);
        
SendClientMessage(playerid, -1"* You received an M4 nigga.");
    }
    else if(
strcmp(params"ak47"true) == 0)
    {
        
GivePlayerWeapon(playerid30999999);
        
SendClientMessage(playerid, -1"* You received an AK-47 nigga.");
    }
    else if(
strcmp(params"9mm"true) == 0)
    {
        
GivePlayerWeapon(playerid22999999);
        
SendClientMessage(playerid, -1"* You received a 9mm nigga.");
    }
    else if(
strcmp(params"deagle"true) == 0)
    {
        
GivePlayerWeapon(playerid24999999);
        
SendClientMessage(playerid, -1"* You received a Deagle nigga.");
    }
    else if(
strcmp(params"shotgun"true) == 0)
    {
        
GivePlayerWeapon(playerid25999999);
        
SendClientMessage(playerid, -1"* You received a Shotgun nigga.");
    }
    else if(
strcmp(params"sawnoff"true) == 0)
    {
        
GivePlayerWeapon(playerid26999999);
        
SendClientMessage(playerid, -1"* You received a Sawn Off nigga.");
    }
    else if(
strcmp(params"spas"true) == 0)
    {
        
GivePlayerWeapon(playerid27999999);
        
SendClientMessage(playerid, -1"* You received a Spas nigga.");
    }
    else if(
strcmp(params"uzi"true) == 0)
    {
        
GivePlayerWeapon(playerid28999999);
        
SendClientMessage(playerid, -1"* You received an UZI nigga.");
    }
    else if(
strcmp(params"mp5"true) == 0)
    {
        
GivePlayerWeapon(playerid29999999);
        
SendClientMessage(playerid, -1"* You received an MP5 nigga.");
    }
    else if(
strcmp(params"sniper"true) == 0)
    {
        
GivePlayerWeapon(playerid34999999);
        
SendClientMessage(playerid, -1"* You received a Sniper nigga.");
    }
    else if(
strcmp(params"rifle"true) == 0)
    {
        
GivePlayerWeapon(playerid33999999);
        
SendClientMessage(playerid, -1"* You received a Riffle nigga.");
    }
    else if(
strcmp(params"tec9"true) == 0)
    {
        
GivePlayerWeapon(playerid32999999);
        
SendClientMessage(playerid, -1"* You received a TEC-9 nigga.");
    }
    return 
1;
}
public 
OnPlayerGiveDamage(playeriddamagedidFloat:amountweaponidbodypart)
{
    new 
string[128], bodypartstr[32], weaponstr[32];
    
GetWeaponName(weaponidweaponstr32);
    switch(
bodypart)
    {
        case 
3bodypartstr "Chest";
        case 
4bodypartstr "Groin";
        case 
5bodypartstr "Left Arm";
        case 
6bodypartstr "Right Arm";
        case 
7bodypartstr "Left Leg";
        case 
8bodypartstr "Right Leg";
        case 
9bodypartstr "Head";
    }
    
format(stringsizeof(string), "* You have damaged the player with weapon %s, Damage given: %.4f (Part of body: %s) (Skill: %d%%)"weaponstramountbodypartstrskillsPlayer[playerid][g_aWeaponSlots[GetPlayerWeapon(playerid)]]);
    
SendClientMessage(playerid, -1string);
    return 
1;

I am not sure if this can be used on anything but I have a plan in mind that SetPlayerWeaponSkill should be hooked up with some variable, then i dunno.
Reply
#2

Is it possible to change the given damage OnPlayerGive/TakeDamage?
Reply
#3

No idea about that, though you could compare damage & weapon used ongive / take damage & increase / decrease health manually.
Reply
#4

Quote:
Originally Posted by iLearner
View Post
No idea about that, though you could compare damage & weapon used ongive / take damage & increase / decrease health manually.
Like you could get the before health of the player then decrease it with the desire amount of damage you want?
Reply
#5

You could use this: CLICK HERE
Reply
#6

Example:

Current damage per shot by Deagle is 10hp (you have players health's saved in their data array)
You want to make the damage 12hp:

Quote:

OnPlayerTakeDamage(...)
{
SetPlayerHealth(playerid, Saved_Health);
if(weaponid == Deagle (id ofc))
{
SetPlayerHealth(playerid, Saved_Health-12);
Saved_Health = GetPlayerHealth(...);
}
}

and so on...



PS: JE: I need a good house interior map o.o
Reply
#7

Out of topic: I am not good at mapping but I will try.

On topic: Will try it out thanks.
Reply
#8

Quote:
Originally Posted by iLearner
View Post
Example:

Current damage per shot by Deagle is 10hp (you have players health's saved in their data array)
You want to make the damage 12hp:



and so on...



PS: JE: I need a good house interior map o.o
What about something like this
Code:
OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
    if (weaponid == 24) amount = 15.0; //desired damage

    new Float:health;
    GetPlayerHealth(playerid, health);
    SetPlayerHealth(playerid, health - amount);

    return 1;
}
or https://sampforum.blast.hk/showthread.php?tid=558839
Reply
#9

Quote:
Originally Posted by JaKe Elite
View Post
Is it possible to change the given damage OnPlayerGive/TakeDamage?
Yes, just check the weapon and set the HP manually.
Reply
#10

You shouldn't try setting health under OnPlayerTakeDamage or under OnPlayerGiveDamage because it could be a problem due to SA-MP sync. I suggest you to read the topic by Slice in understanding SA-MP sync.

You can add more damage rate for a weapon but if you're trying to customize the weapon damage totally, I suggest you to work on server sided health system, which is the best method to have complete control over damage rates.

I once created an include called L_Skills that adds more damage to any weapon. But now I realise that it could be a problem while dealing with players having high ping, say 350+. I wasn't aware about SA-MP sync those days and never cared about updating it either (mostly due to lack of motivation). To have a fix over such an issue, it's better to have a boolean variable to know if the update for health change has been triggered under take/give damage callback and then reduce the health under OnPlayerUpdate only. I had tested this earlier and seemed to work flawlessly.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)