i need idea. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: i need idea. (
/showthread.php?tid=273096)
i need idea. -
EviLpRo - 31.07.2011
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
Re: i need idea. -
Toreno - 31.07.2011
You can use OnPlayerUpdate, really useful.
Also, you better check if the player runs out of ammo, had this before.
Re: i need idea. -
EviLpRo - 31.07.2011
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..
Re: i need idea. -
MoroDan - 31.07.2011
You tried like this:
PHP код:
public OnPlayerUpdate(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;
}
?
Re: i need idea. -
EviLpRo - 31.07.2011
yes . but this not working..
Re: i need idea. -
EviLpRo - 31.07.2011
somebody ?
Re: i need idea. -
EviLpRo - 31.07.2011
please help..
this very importent.
Re: i need idea. -
EviLpRo - 01.08.2011
help please ?