/frisk - 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: /frisk (
/showthread.php?tid=36212)
/frisk -
stefanlg - 04.05.2008
How do i frisk someone for weapons and have it show what weapons they have.
Re: /frisk -
Amit - 05.05.2008
Use the
GetPlayerWeaponData function
Re: /frisk -
stefanlg - 05.05.2008
Yea i tryed that but i couldent get it to work. Can you give me an example for it?
Re: /frisk -
kaisersouse - 05.05.2008
Quote:
|
Originally Posted by Cybertron
|
IIRC correctly that function is either bugged, or damn near impossible to use correctly.
Re: /frisk -
Backwardsman97 - 05.05.2008
Quote:
|
Originally Posted by kaisersouse
Quote:
|
Originally Posted by Cybertron
|
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.
Re: /frisk -
Kapil - 05.05.2008
Quote:
|
Originally Posted by kaisersouse
Quote:
|
Originally Posted by Cybertron
|
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.
Re: /frisk -
stefanlg - 05.05.2008
I tryed your code but it doesn't show what weapons or ammo they have.
Re: /frisk -
Kapil - 05.05.2008
Код:
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);
}
}
Re: /frisk -
stefanlg - 05.05.2008
ahh. ok now it works
Re: /frisk -
Tr1viUm - 05.05.2008
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.