Quick and Easy Question
#1

Well, I haven't been into scripting for a while..
But I was wondering how to fix it so you can't shoot a SPAS or AK47 as a passanger in a Car.

I still want it so they can shoot an MP5 though.. Thanks.
Reply
#2

You could probably use GetPlayerWeapon on OnPlayerEnterVehicle and then switch there current weapon to there fists or something.

Haven't done this ever, could probably search, I bet a ton of people have done this before.
Reply
#3

Could try this
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
    {
        new Weap[2];
        GetPlayerWeaponData(playerid, 4, Weap[0], Weap[1]); // Get the players SMG weapon in slot 4
        SetPlayerArmedWeapon(playerid, Weap[0]); // Set the player to driveby with SMG
    }
    return 1;
}
Reply
#4

Don't use OnPlayerEnterVehicle for code like this.

OnPlayerEnterVehicle gets called as soon as the player presses the 'enter' key. Thus making it useless.
Reply
#5

PHP код:
public OnPlayerStateChange(playeridnewstateoldstate){
   if(
oldstate==PLAYER_STATE_ONFOOT &&  newstate==PLAYER_STATE_PASSENGER){
      if(
GetPlayerWeapon(playerid)==26 || GetPlayerWeapon(playerid)==30){
         
SetPlayerArmedWeapon(playerid,0);
      }
   }

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)