• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Does the fire truck's water launcher haves sync with the server?
#1
Information 
Does the fire truck's water launcher haves sync with the server?
Code:
Discord: Marllun#6297
  Reply
#2
What do you mean by that?
  Reply
#3
Do you know the water launcher on the fire truck? has some way of detecting that it is being used, and the position that the water is falling?
Code:
Discord: Marllun#6297
  Reply
#4
I'm not sure if that's possible
  Reply
#5
Check if Weapon Shot callback is called (it's probably not), see key changes and if they're in a firetruck as a driver and holding LMB - that's it.
Using Pawn.CMD?

If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.
  Reply
#6
Actually, I have an idea for you. (Although, I'm not sure if it will work). There is no need to do anything in OnPlayerWeaponShot.

Code:
new gFireTruckID = 407;

#define HOLDING(%0) \
    ((newkeys & (%0)) == (%0))

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
     if (IsPlayerInVehicle(playerid, gFireTruckID))
     {
        if (HOLDING(KEY_FIRE) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
           SendClientMessage(playerid, -1, "You are currently spreading water from a Firetruck.");
        }
     }

     return 1;
}
  Reply
#7
(2021-03-01, 03:24 PM)destiezk Wrote: Actually, I have an idea for you. (Although, I'm not sure if it will work). There is no need to do anything in OnPlayerWeaponShot.



Code:
new gFireTruckID = 407;



#define HOLDING(%0) \

((newkeys & (%0)) == (%0))



public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)

{

? ? if (IsPlayerInVehicle(playerid, gFireTruckID))

? ? {

? ? ? ? if (HOLDING(KEY_FIRE) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)

? ? ? ? {

? ? ? ? ? SendClientMessage(playerid, -1, "You are currently spreading water from a Firetruck.");

? ? ? ? }

? ? }



? ? return 1;

}



I've used this script, but it's inaccurate because I can't know where the player is pointing.
Code:
Discord: Marllun#6297
  Reply
#8
(2021-03-01, 03:35 PM)Marllun Wrote:
(2021-03-01, 03:24 PM)destiezk Wrote: Actually, I have an idea for you. (Although, I'm not sure if it will work). There is no need to do anything in OnPlayerWeaponShot.



Code:
new gFireTruckID = 407;



#define HOLDING(%0) \

((newkeys & (%0)) == (%0))



public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)

{

? ? if (IsPlayerInVehicle(playerid, gFireTruckID))

? ? {

? ? ? ? if (HOLDING(KEY_FIRE) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)

? ? ? ? {

? ? ? ? ? SendClientMessage(playerid, -1, "You are currently spreading water from a Firetruck.");

? ? ? ? }

? ? }



? ? return 1;

}



I've used this script, but it's inaccurate because I can't know where the player is pointing.



I'm not sure why it is inaccurate? It writes if you're spreading water, getting the position where the water is falling is not possible I think, but correct me somebody
  Reply
#9
Im not sure but you can try theese functions:



Code:
GetPlayerCameraPos

Code:
GetPlayerCameraFrontVector
  Reply
#10
Heart 
(2021-03-01, 07:10 PM)rasheed Wrote: Im not sure but you can try theese functions:



Code:
GetPlayerCameraPos

Code:
GetPlayerCameraFrontVector



Thanks, using this, to be able to make an object in front of the camera (where it is looking at) and compare the distance with the coordinate.
Code:
Discord: Marllun#6297
  Reply


Forum Jump: