Check player's weapons - 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: Check player's weapons (
/showthread.php?tid=118391)
Check player's weapons -
Marc_307 - 03.01.2010
HI, I've got a problem.
The server gives everyone a random weapons when they spawn. I don't want that they get granades and a rocket launcher together. One of them get exchanged for a minigun or tear gas. So I wrote that code below, but it doesn't work. Is anybody capable to help me? TIA
Код:
new myweapon[13][2];
new newweapon[]={17,38};
new wRandom=random(sizeof(newweapon));
GetPlayerWeaponData(playerid,7,myweapon[7][0],myweapon[7][1]);
GetPlayerWeaponData(playerid,8,myweapon[8][0],myweapon[8][1]);
if(myweapon[7][0]==35&&myweapon[8][0]==16)GivePlayerWeapon(playerid,newweapon[wRandom],random(9998)+1);
GetPlayerWeaponData(playerid,7,myweapon[7][0],myweapon[7][1]);
GetPlayerWeaponData(playerid,8,myweapon[8][0],myweapon[8][1]);
RLorG_owner[playerid]=0;
if(myweapon[8][0]==16)RLorG_owner[playerid]+=1;
else if(myweapon[7][0]==35)RLorG_owner[playerid]+=2;
Re: Check player's weapons -
[HiC]TheKiller - 03.01.2010
THIS POST WAS WRONG PLEASE DELETE THIS

.
Re: Check player's weapons -
Marc_307 - 03.01.2010
Thanks man, but "argument type mismatch (argument 3)" at GetPlayerWeaponData...
Re: Check player's weapons -
[HiC]TheKiller - 03.01.2010
pawn Код:
new Weapons[2];
GetPlayerWeaponData(playerid, 7, Weapons[0]);
GetPlayerWeaponData(playerid, 8, Weapons[1]);
if(Weapons[0] == 35 && Weapons[1] == 16)
{
new Random = random(2);
if(Random == 0)
{
GivePlayerWeapon(playerid, 17, random(9998)+1);
}
if(Random == 1)
{
GivePlayerWeapon(playerid, 38, random(9998)+1);
}
}
Sorry, forgot the parameters for GetPlayerWeaponData :P.