need help!
#1

In my server a player can drive by with any weapon how can I make some weapons not drivebyable?
Reply
#2

You can remove player's weapons when the player enters a vehicle.
Reply
#3

Let's try it again...
When a player enters with a M4, SMG[mp5], a deagle, and a combat. I want to make it only DB with M4 and SMG. But now it DBs when you have Deagle and combat
Reply
#4

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
    if(IsPlayerInAnyVehicle(issuerid) && (weaponid !=31 || weaponid != 29))
    {
        SetPlayerHealth(issuerid,-100.0);
        SendClientMessage(playerid,0xFF0000FF,"Drive-by isn;'t allowed!");
    }
    return 1;
}
Something like this?
Reply
#5

No.

When I enter a car as a passenger I can drive by with ALL weapons. How can I make some weapons not to drive by with.
Reply
#6

I understood
Add this code under OnPlayerEnterVehicle
pawn Код:
* * if(GetPlayerWeapon(playerid) == 24 )//this is for desert eagle you can add more.
* * {
* * * * SetPlayerArmedWeapon(playerid, 0);
* * }
If u see the * marks then pls remove them idk how they came.if u.dont see them its good.
Reply
#7

hmm just saying, would this work?

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
     new pstate = GetPlayerState(playerid);
     if(pstate == PLAYER_STATE_PASSENGER) // change PASSENGER to DRIVER if you want
     {      
          if(GetPlayerWeapon(playerid) == 24) // 24 is the deagle id
          {
                   SetPlayerArmedWeapon(playerid,0); // will disable the player's weapon
          }
        // here you can put more undrivebyable weapons like the lines ABOVE ^
     }
return 1;
}
Reply
#8

Quote:
Originally Posted by HellSphinX
Посмотреть сообщение
hmm just saying, would this work?

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
     new pstate = GetPlayerState(playerid);
     if(pstate == PLAYER_STATE_PASSENGER) // change PASSENGER to DRIVER if you want
     {      
          if(GetPlayerWeapon(playerid) == 24) // 24 is the deagle id
          {
                   SetPlayerArmedWeapon(playerid,0); // will disable the player's weapon
          }
        // here you can put more undrivebyable weapons like the lines ABOVE ^
     }
return 1;
}
according to your code driver can driveby but passenger can't.in my code above both can't driveby and whats the need to check player state because he us in a vehicle and thats what we need.
Reply
#9

Quote:
Originally Posted by [HK]Ryder[AN]
Посмотреть сообщение
according to your code driver can driveby but passenger can't.in my code above both can't driveby and whats the need to check player state because he us in a vehicle and thats what we need.
Quote:
Originally Posted by KosmasRego
Посмотреть сообщение
No.

When I enter a car as a passenger I can drive by with ALL weapons. How can I make some weapons not to drive by with.
i thought he want it when a player enter a vehicle as a PASSENGER!
Reply
#10

ty HellSphinX and Ryder rep ++
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)