How do I check if a player's weapon change?
#1

How do I check if a player's weapon change?

I tried everything, but it doesnt work.

I tried to set a timer on player connect that checks for first weapon and a timer that checks for the second weapon, and it works only if you change that weapon in 50 cs.

Please help.

Thanks.
Reply
#2

Use if(GetPlayerWeapon(playerid) == WeaponID)

Do this
pawn Код:
SetTimer("CheckWeapons",1000,true); //This Goes To |OnPlayerConnect|

//Then
forward CheckWeapons(playerid);
public CheckWeapons(playerid)
{
if(GetPlayerWeapon(playerid) == 38)
     {
     SendCLientMEssage(playerid,YELLOW,"You have a minigun!!!");
     } //This si a MiniGun is an Example
return 1;
}
Reply
#3

lol, thanks, but I don't want this xD, I want something like:

OnPlayerWeaponStateChange(playerid, oldweapon, newweapon);
Reply
#4

There is an example at the OnPlayerUpdate article at the wiki https://sampwiki.blast.hk/wiki/OnPlayerUpdate
Reply
#5

https://sampforum.blast.hk/showthread.php?tid=59771 There's a OnPlayerWeaponChange callback here. Hope that helps.
Reply
#6

Thank you! It works
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)