Posts: 135
Threads: 5
Joined: Mar 2010
Reputation:
0
How to check if the player has a М4, if he has nothing in hand
For example I have a MP5 in hand and now how to check if I have M4 in me
Posts: 135
Threads: 5
Joined: Mar 2010
Reputation:
0
forward CheckMissionWeapon();
public CheckMissionWeapon()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new w,a;
GetPlayerWeaponData(i,5,w,a);
if(w != 31)
{
SendClientMessage(i, COLOR_WHITE, "You not have M4 so you can't pass this mission");
}
}
}
return 1;
}
But not work
Any Help
Posts: 135
Threads: 5
Joined: Mar 2010
Reputation:
0
i replaced but it stil not work
Any Help ?
Posts: 3,488
Threads: 16
Joined: Jun 2007
Reputation:
0
How do you use this function CheckMissionWeapon() ?
Posts: 135
Threads: 5
Joined: Mar 2010
Reputation:
0
ongamemodeinit
SetTimer("CheckMissionWeapon", 1000, 1);//Spam message if player not have M4
Posts: 2,593
Threads: 34
Joined: Dec 2007
Remove first return 1; it blocks loop