Grenade's - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Grenade's (
/showthread.php?tid=189847)
Grenade's -
Bessensap - 13.11.2010
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?
Re: Grenade's -
boelie - 13.11.2010
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
Re: Grenade's -
0ne - 13.11.2010
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.
Re: Grenade's -
Bessensap - 13.11.2010
@boelie&0ne, Yes that could work.. would be alot easier i guess.
@0ne's second argument, Shit. Didnt think about that yet.
Re: Grenade's -
DeathOnaStick - 13.11.2010
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.