05.06.2010, 14:40
Quote:
Originally Posted by Fog™
sounds cool!cud be awzum if it cud be in SF !:P
|
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 }
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.