driveby problem
#1

how to make only MP5 able to drive by and disable other guns like deagle, spas12, m4, sniper etc.

I want to make MP5 only available to DB.
Reply
#2

you can do a check with what weapon the player enters into the vehicle
like under
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(GetPlayerWeapon(playerid) == 29)
    {
    //The players Enters the vehicle with MP5
    }else{
    /*You got 2 options [1] to ResetThePlayer Weapons
    //[2] to givehim wep id (0) witch will se the player holding no weapon
    Option [1]*/

    ResetPlayerWeapons(playerid);
    //Option[2]
    GivePlayerWeapon(playerid, 0, 1);
    }
    return 1;
}
Just choose one option and remove the other one
Reply
#3

dp a check and if any other guns then MP5 were on the hand of the guy seating as a passanger,Auto scroll to "Unarmed" which means "hand"
Reply
#4

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)// OnPlayerEnterVehicle callback, gets called when a player enters a vehicle.
{
    if(GetPlayerWeapon(playerid) == 29)// If player has MP5
    {
        return 1;// Returns value ( nothing. )
    }
    else// What happens if he doesn't have a MP5
    {
        SendClientMessage(playerid, 0xAA3333AA, " You canno't drive-by with a desert eagle !");// Sending a message
        GivePlayerWeapon(playerid, 0, 1); // Giving him fist, so he won't be able to use it.
        return 1;// Returning value for SendClientMessage
    }
    return 1; // Returning value, a must have.
}
Reply
#5

tyy worked
Reply
#6

No problem.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)