Check player's weapons
#1

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;
Reply
#2

THIS POST WAS WRONG PLEASE DELETE THIS .
Reply
#3

Thanks man, but "argument type mismatch (argument 3)" at GetPlayerWeaponData...
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)