Hello Need small help plz
#1

Код:
	
       for (new i = 0; i <= 12; i++)
	{
	 	GetPlayerWeaponData(playerid, i, weapons[playerid][i], PlayerWeaponAmmo[playerid][i]);
		if(weapons[playerid][i] == WEAPON_GOLFCLUB)
		{ 
		Kick(playerid);
		}
	}
Why its not working?
I use this because GetPlayerWeapon(playerid) only work for the weapon in hand at moment.

How to check player have WEAPON_GOLFCLUB?

Kindly Help

Thanks.
Reply
#2

Try this chabge the number off the golf club weapon id
PHP код:
new gun[2]; 
GetPlayerWeaponData(playerid5gun[0], gun[1]); 
if(
gun[0] == 30
SendClientMessage(playerid,-1,"You Have AK-47"); 
Reply
#3

i try that already that also not working..
Reply
#4

Copy exactly that code and give you an ak47 and you will se it's work perfect
Reply
#5

Nope not work.
Reply
#6

Pretty sure it's this bit in your code

Код:
Kick(playerid);
Add this to your code

Код:
new kick_gTimer[MAX_PLAYERS];

stock Kick(playerid) {
    KillTimer(kick_gTimer[playerid]);
    kick_gTimer[playerid] = SetTimerEx("DelayedKick", 500, false, "i", playerid);
    return 1;
}
and try now
Reply
#7

lol I want to getplayerweapon which he have in slots rather than delaying kick.
Reply
#8

Bilal have fb ..pm me
Reply
#9

Fb ki id hy to pm kr do
Reply
#10

Every type of weapon has a slot, so whenever you take it it'll get in that slot or replace the one on it, you don't need to check all the slots, just the one holding the weapon.
As for "WEAPON_GOLFCLUB", the slot is 1, So you'll just have to:
pawn Код:
GetPlayerWeaponData(playerid, 1, weapons[playerid], PlayerWeaponAmmo[playerid]);
if(weapons[playerid] == WEAPON_GOLFCLUB) Kick(playerid);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)