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.
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.");
}
}
(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.
(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