/frisk
#1

How do i frisk someone for weapons and have it show what weapons they have.
Reply
#2

Use the GetPlayerWeaponData function
Reply
#3

Yea i tryed that but i couldent get it to work. Can you give me an example for it?
Reply
#4

Quote:
Originally Posted by Cybertron
Use the GetPlayerWeaponData function
IIRC correctly that function is either bugged, or damn near impossible to use correctly.
Reply
#5

Quote:
Originally Posted by kaisersouse
Quote:
Originally Posted by Cybertron
Use the GetPlayerWeaponData function
IIRC correctly that function is either bugged, or damn near impossible to use correctly.
I've never seen that function before. But Idk where to start to use it.
Reply
#6

Quote:
Originally Posted by kaisersouse
Quote:
Originally Posted by Cybertron
Use the GetPlayerWeaponData function
IIRC correctly that function is either bugged, or damn near impossible to use correctly.
it wox fine.

Код:
new Player_Weapons[13];
new Player_Ammos[13];

for(i = 1;i <= 12;i++)
{
GetPlayerWeaponData(playerid,Player_Weapons[i],Player_Ammos[i]);
}
now Player_Weapon[ 1 -12 ] has weaponids of 1 - 12 slots respectively.
and Player_Ammos[ 1 -12 ] has no. of ammos of that weapon.
Reply
#7

I tryed your code but it doesn't show what weapons or ammo they have.
Reply
#8

Код:
new Player_Weapons[13];
new Player_Ammos[13];
new i;

for(i = 1;i <= 12;i++)
{
	GetPlayerWeaponData(playerid,i,Player_Weapons[i],Player_Ammos[i]);
	if(Player_Weapons[i] != 0)
	{
		new weaponName[256],string[256];
		GetWeaponName(Player_Weapons[i],weaponName,255);
		format(string,255,"Weapon Name: %s | Weapon Ammo's: %d.",weaponName,Player_Ammos[i]);
		SendClientMessage(playerid,0xFFFFFFAA,string);
	}
}
Reply
#9

ahh. ok now it works
Reply
#10

Kapil: It does, but not correctly. Now and then GetPlayerWeaponData and GetPlayerAmmo will return the wrong ammo amount, around 65554 when it happens. Although you can script that when the ammo is higher than 65550 it won't find it with frisk. Or just let them find around 100 ammo automaticly.

I've never had problems with returning the weapon ids inaccurate though.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)