i need idea.
#1

hello !

I built a new weapon is my serve.
Built on a Baseball bat weapons.

But I have a small problem.
I tried to do that once a player replaces weapons, that he suppress the object ..
I like this timer is supposed to check if the player's weapon is not equal to 5:

pawn Код:
public WeaponsTimer(playerid)
{
    if(GetPlayerWeapon(playerid) == 5 && !IsPlayerInAnyVehicle(playerid))
    {
        RemovePlayerAttachedObject(playerid,0);
        SetPlayerAttachedObject(playerid,0,2045,6,0.039999,0.000000,0.250000,90.000000,0.000000,0.000000,3.800000,1.300000,3.800000);
    }
    else
    {
        RemovePlayerAttachedObject(playerid,0);
    }
    return true;
}
But it takes the object only after a second or so since he replace the weapon.
Does anyone have an idea how to do it directly suppress the object?
Thanks in advance helpers
Reply
#2

You can use OnPlayerUpdate, really useful.
Also, you better check if the player runs out of ammo, had this before.
Reply
#3

Quote:
Originally Posted by EliranPesahov
Посмотреть сообщение
You can use OnPlayerUpdate, really useful.
Also, you better check if the player runs out of ammo, had this before.
i try this.
but this not work.
the weapon destroy after second..
Reply
#4

You tried like this:
PHP код:
public OnPlayerUpdate(playerid)
{
    if(
GetPlayerWeapon(playerid) == && !IsPlayerInAnyVehicle(playerid))
    {
        
RemovePlayerAttachedObject(playerid,0);
        
SetPlayerAttachedObject(playerid,0,2045,6,0.039999,0.000000,0.250000,90.000000,0.000000,0.000000,3.800000,1.300000,3.800000);
    }
    else
    {
        
RemovePlayerAttachedObject(playerid,0);
    }
    return 
true;

?
Reply
#5

yes . but this not working..
Reply
#6

somebody ?
Reply
#7

please help..
this very importent.
Reply
#8

help please ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)