Grenade's
#1

Hey,
I'm making a script involving throwing grenades/smokegrenades etc.. but how could i get the pos of the grenade thrown?

I thought of:
pawn Код:
//OnPlayerUpdate
GetPlayerKeys, KEY_FIRE etc etc
Throwdistance[playerid]++ // for every (time) you hold the clickbutton, it goes +1
GetXYInfrontofplayer(x,y,Throwdistance(with some formula)
If(IsPlayerInArea,x-5,x+5,y-5,y+5)
{
 //do this
Could work right?
Reply
#2

you could somehow check how far the grenade can be throwed
i found out a player can throw a grenade far away or not far..it also gets another animation like here;

WEAPON_start_throw ==start trowing
WEAPON_throw = throwing far
WEAPON_throwu = closeby
Reply
#3

u can try to get the animations and then calculate how far those 3anims can throw the grenade, but i don't think that will be accurate cause he can throw it off a hill,into the wall or so.
Reply
#4

@boelie&0ne, Yes that could work.. would be alot easier i guess.

@0ne's second argument, Shit. Didnt think about that yet.
Reply
#5

Quote:
Originally Posted by 0ne
Посмотреть сообщение
u can try to get the animations and then calculate how far those 3anims can throw the grenade, but i don't think that will be accurate cause he can throw it off a hill,into the wall or so.
You can use this plugin to check if the grenade rolls down a hill/hits a wall, i think, but i'm not 100% sure, because i never used this plugin myself (yet), anyway, i think it's worth a try.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)