[FilterScript] [FS] Sprays in LS
#6

Quote:
Originally Posted by Fog™
sounds cool!cud be awzum if it cud be in SF !:P
It can, and it's pretty easy, although it will require some work from you to do.

Look at the code, it's almost automatic the process:

Code:
if(IsPlayerInRangeOfPoint(playerid, 1.0, 893.3028,-1117.3040,24.1885) && (angle >= 172 && angle <= 205)) // 1
	{
       SetPlayerPos(playerid, 893.2590,-1116.1653,24.2183); // 2
       SetPlayerFacingAngle( playerid, 182 ); // 3
       SPRAYMSG // 4
       Timer[playerid] = SetTimerEx("OnPlayerSpray",2000,false,"diffffii",playerid,0,893.3028,-1117.6,24.1885,270.0,400, newkeys); // 5
	}
1 - Here you have to set the playerid, the x,y & z positions of where to stand to spray and the angle to look at when spraying.
2 - Here you have to set the playerid position to place him when he starts spraying.
3 - The angle the player will face when spraying.
4 - This is a message defined in the first lines of the script.
5 - This is the function itself. Parameters are (diffffi): playerid - idofthespray - X,Y & Z pos of the spray, Angle of the spray, moneygivenforspray - the key to pass. <-- I had to pass the key because when playing with another player, it wouldn't recognize the keys he pressed, but mine did. I guess this was more related to my npc filterscript.

Anyway, just read the code and you'll find it's pretty simple. And a suggestion i didn't do: add an angle check when the player sprays, becuse he can look the otherway around when he pressed the KEY_FIRE and still spray.
Reply


Messages In This Thread
[FS] Sprays in LS - by clavador - 05.06.2010, 00:33
Re: [FS] Sprays in LS - by Lorenc_ - 05.06.2010, 01:56
Re: [FS] Sprays in LS - by UnHead - 05.06.2010, 09:57
Re: [FS] Sprays in LS - by WardenCS - 05.06.2010, 10:19
Re: [FS] Sprays in LS - by clavador - 05.06.2010, 14:28
Re: [FS] Sprays in LS - by clavador - 05.06.2010, 14:40

Forum Jump:


Users browsing this thread: 2 Guest(s)