SA-MP Forums Archive
[Help]Anti Driveby - 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: [Help]Anti Driveby (/showthread.php?tid=115387)



[Help]Anti Driveby - Oi! - 23.12.2009

Okay guys, I'm trying to make an Anti Driveby but the "SetPlayerAmmo" doesn't work for 0.3a, I want it so when the player enters the vehicle with any gun like the "MP5", "UZI" etc etc it will set their ammo to -30-30 so they can't shoot it, but when they get out of the car it sets their ammo back to 65000. Can anyone help me figure out this simple function?


Re: [Help]Anti Driveby - DeltaAirlines12 - 23.12.2009

Theres a filterscript(s) for what your trying to do... try this: http://forum.sa-mp.com/index.php?action=search


Re: [Help]Anti Driveby - Andrew_David - 24.12.2009

SZR have this...you are szr admin?


Re: [Help]Anti Driveby - [HiC]TheKiller - 24.12.2009

Well, it's possible by doing this:

pawn Код:
//TOP
new DriveByGun[MAX_PLAYERS][2];

public OnPlayerStateChange(playerid, newstate, oldstate)
{
   if(newstate == PLAYER_STATE_DRIVER)
   {
     GetPlayerWeaponData(playerid, 4, DriveByGun[playerid][0], DriveByGun[playerid][1];
     if(DriveByGun[playerid][0] == 29)
     {
       GivePlayerWeapon(playerid, 28 0);
     }  
     else
     {
       GivePlayerWeapon(playerid, 29, 0);
     }
   }
   return 1;
}

public OnPlayerExitVehicle(playerid)
{
  if(DriveByGun[playerid][0] == 28 || DriveByGun[playerid][0] == 29 || DriveByGun[playerid][0] == 32)
  {
    GivePlayerWeapon(playerid, DriveByGun[playerid][0], DriveByGun[playerid][1]);
  }
  return 1;
}
Quote:
Originally Posted by .:: ZeX ::.
deleted XD
Stop posting random shit for your post count, it's not even edited.