SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 05/03/2018, 01:59 AM   #21
z[D]ark
Little Clucker
 
z[D]ark's Avatar
 
Join Date: Sep 2016
Location: Brasil, SP.
Posts: 13
Reputation: 3
Default Re: hacker killing everyone

Quote:
Originally Posted by cessil View Post
And you should add detection for fast bullet shots, ammo loss, if they have the weapon, distance, etc.
I did ask you to post your attempt, this section is for helping others not scripting for others.

here's a snippet of weapon firing speed
Code:
enum WeapEnum {
	WeapID,
	Float:WBaseDamage,
	Float:WeapRange,
	FireRate,
}

new WeaponData[][WeapEnum] = {
	{ 0, 10.0000, 10.0000 , 250 },//fists
	{ 1, 0.0000, 0.0000 , 0 },//unused
	{ 2, 0.0000, 0.0000 , 0 },//unused
	{ 3, 0.0000, 0.0000 , 0 },//unused
	{ 4, 0.0000, 0.0000 , 0 },//unused
	{ 5, 0.0000, 0.0000 , 0 },//unused
	{ 6, 0.0000, 0.0000 , 0 },//unused
	{ 7, 0.0000, 0.0000 , 0 },//unused
	{ 8, 0.0000, 0.0000 , 0 },//unused
	{ 9, 0.0000, 0.0000 , 0 },//unused
	{ 10, 0.0000, 0.0000 , 0 },//unused
	{ 11, 0.0000, 0.0000 , 0 },//unused
	{ 12, 0.0000, 0.0000 , 0 },//unused
	{ 13, 0.0000, 0.0000 , 0 },//unused
	{ 14, 0.0000, 0.0000 , 0 },//unused
	{ 15, 0.0000, 0.0000 , 0 },//unused
	{ 16, 0.0000, 0.0000 , 0 },//unused
	{ 17, 0.0000, 0.0000 , 0 },//unused
	{ 18, 0.0000, 0.0000 , 0 },//unused
	{ 19, 0.0000, 0.0000 , 0 },//unused
	{ 20, 0.0000, 0.0000 , 0 },//unused
	{ 21, 0.0000, 0.0000 , 0 },//unused
	{ 22, 8.000000, 35.00000, 100 },//9mm
	{ 23, 13.000000, 35.00000, 250 },//silencer
	{ 24, 46.000000, 35.00000, 600 },//deagle
	{ 25, 3.300000, 40.00000, 750 },//shotgun
	{ 26, 3.300000, 35.00000, 75 },//sawn off
	{ 27, 4.950000, 40.00000, 230 },//combat
	{ 28, 6.600000, 35.00000, 75 },//uzi
	{ 29, 8.250000, 45.00000, 50 },//mp5
	{ 30, 9.900000, 70.00000, 40 },//ak-47
	{ 31, 9.900000, 90.00000, 40 },//m4
	{ 32, 6.600000, 35.00000, 75 },//uzi
	{ 33, 25.00000, 100.00000, 500 },//rifle
	{ 34, 41.0000, 100.00000, 500 }, //sniper rifle
	{ 35, 0.00000, 0.00000, 0 }, //unused
	{ 36, 0.00000, 0.00000, 0 }, //unused
	{ 37, 0.00000, 0.00000, 0 }, //unused
	{ 38, 46.00000, 75.00000, 5 } //minigun
};

public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
	//ammo lock
	if(!GetPVarInt(playerid,"DSync")) ShotPlayer{playerid} = 1;
	
	//sped up gameplay
	if(weaponid == GetPVarInt(playerid,"lastDamageWeapon"))
	{
		if(GetTickCount() - GetPVarInt(playerid,"lastDamageTime") < WeaponData[weaponid][FireRate] * 0.40)
		{
			discard the shot
			return 0;
		}
	}

	if(weaponid != GetPlayerWeapon(playerid))
	{
		discard the shot
		return 0;
	}
	
	return 1;
}
Thank you, i will try to use this and then i will tell you the results and sorry for not sending my code, i thought i would not need it, since it had not worked.

Quote:
Originally Posted by Jefff View Post
Do you have custom damage system?
Yes, i had... I thought there were mistakes and i removed. Then discovered i was a cheater.
z[D]ark is offline   Reply With Quote
Old 05/03/2018, 02:08 AM   #22
cessil
High-roller
 
cessil's Avatar
 
Join Date: Apr 2009
Posts: 1,346
Reputation: 296
Default Re: hacker killing everyone

you will need to set them on the same team and then process the damage yourself, just copy and pasting will not work
cessil is offline   Reply With Quote
Old 05/03/2018, 02:12 AM   #23
Jefff
Banned
 
Join Date: Dec 2007
Posts: 2,593
Reputation: 326
Default Re: hacker killing everyone

This is what I wrote here http://forum.sa-mp.com/showpost.php?...1&postcount=32
He dont need sends bullets, just calling Give/Take damage and boom
Jefff is offline   Reply With Quote
Old 05/03/2018, 03:12 AM   #24
Sew_Sumi
Banned
 
Join Date: Jun 2008
Location: Azerbaijan
Posts: 6,243
Reputation: 525
Default Re: hacker killing everyone

Yea, actually, where-as if you jump off something, you will take damage, this should be a give damage situation.
Sew_Sumi is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hacker Killing Himself/Fake Kill Guest123 Scripting Help 5 13/06/2013 01:54 PM
[Ajuda] Ant Hacker Andre_Elite Português/Portuguese 17 21/01/2013 01:41 PM
[Ajuda] Ant Hacker Kirikage Português/Portuguese 13 09/11/2012 08:13 PM
Hacker got me :O DaneAMattie General 1 10/08/2010 11:48 AM


All times are GMT. The time now is 09:24 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.