Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Pawn Scripting [Pawn] Does the fire truck's water launcher haves sync with the server?

 
  • 0 Vote(s) - 0 Average
Pawn Does the fire truck's water launcher haves sync with the server?
Marllun
Offline

Burgershot Member
Posts: 16
Threads: 3
Joined: Apr 2019
Reputation: 0
#1
2021-03-01, 01:14 PM
Does the fire truck's water launcher haves sync with the server?
Code:
Discord: Marllun#6297
destiezk
Offline

Burgershot Member
Posts: 41
Threads: 1
Joined: Feb 2021
Reputation: 3
Location: Hungary
#2
2021-03-01, 01:57 PM
What do you mean by that?
Marllun
Offline

Burgershot Member
Posts: 16
Threads: 3
Joined: Apr 2019
Reputation: 0
#3
2021-03-01, 02:04 PM
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
destiezk
Offline

Burgershot Member
Posts: 41
Threads: 1
Joined: Feb 2021
Reputation: 3
Location: Hungary
#4
2021-03-01, 02:04 PM
I'm not sure if that's possible
Pinch
Offline

Burgershot Member
Posts: 391
Threads: 19
Joined: Apr 2019
Reputation: 22
Location: Belgrade, Serbia
#5
2021-03-01, 02:38 PM
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.
destiezk
Offline

Burgershot Member
Posts: 41
Threads: 1
Joined: Feb 2021
Reputation: 3
Location: Hungary
#6
2021-03-01, 03:24 PM (This post was last modified: 2021-03-01, 03:28 PM by destiezk.)
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;
}
Marllun
Offline

Burgershot Member
Posts: 16
Threads: 3
Joined: Apr 2019
Reputation: 0
#7
2021-03-01, 03:35 PM
(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
destiezk
Offline

Burgershot Member
Posts: 41
Threads: 1
Joined: Feb 2021
Reputation: 3
Location: Hungary
#8
2021-03-01, 03:39 PM
(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
rasheed
Offline

Burgershot Member
Posts: 11
Threads: 1
Joined: Apr 2019
Reputation: 0
#9
2021-03-01, 07:10 PM (This post was last modified: 2021-03-01, 07:12 PM by rasheed.)
Im not sure but you can try theese functions:

Code:
GetPlayerCameraPos
Code:
GetPlayerCameraFrontVector
Marllun
Offline

Burgershot Member
Posts: 16
Threads: 3
Joined: Apr 2019
Reputation: 0
#10
2021-03-02, 06:59 AM
(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
« Next Oldest | Next Newest »



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Burgershot - Powered by our Community and MyBB Original Theme by Emerald

Linear Mode
Threaded Mode