How to detect this?
#1

Hello how about ...

I was thinking how to make a system, which consists is to throw a smoke bomb (weapon id 17) and the person who is close to it is applied animation when you check spray paint the face of a character (which by the way, I'm also looking for entertainment but can not find it). Thanks in advance.
Reply
#2

Have you tried anything?
Reply
#3

Nope, I do not know how to detect smoke bomb :/
Reply
#4

Up !
Reply
#5

Check for damages done by weapon ID 17?
Reply
#6

Quote:
Originally Posted by Dignity
Посмотреть сообщение
Check for damages done by weapon ID 17?
That's the problem, smoke bomb does not cause damage.
Reply
#7

Well as far as i know you can make damage for it.
check the weapon if the player has an smoke bomb then set it health to X amount you want to take .. or you dont want that.
Reply
#8

Only way i can think right now is making a physics simulation when player throws the bomb. Also taking care of player actually throwing the bomb and at how much force which can be checked using OnPlayerKeyStateChange and OnPlayerUpdate. You can use physics include for simulation purpose.
Reply
#9

Quote:
Originally Posted by Gammix
Посмотреть сообщение
Only way i can think right now is making a physics simulation when player throws the bomb. Also taking care of player actually throwing the bomb and at how much force which can be checked using OnPlayerKeyStateChange and OnPlayerUpdate. You can use physics include for simulation purpose.
I think you've given me an idea, but...

Using this function, for example, how many meters or centimeters would have to increase for each update OnPlayerUpdate?

Код:
stock GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
	// Created by ******

	new Float:a;

	GetPlayerPos(playerid, x, y, a);
	GetPlayerFacingAngle(playerid, a);

	if (GetPlayerVehicleID(playerid)) {
	    GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
	}

	x += (distance * floatsin(-a, degrees));
	y += (distance * floatcos(-a, degrees));
}
Reply
#10

You should calculate the distance based on a formula:
Код:
DIST = (LMBReleaseTime-LMBPressTime) * X;
rather than increasing distance at every player update
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)