18.09.2011, 17:21
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.
I want to make MP5 only available to DB.
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;
}
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.
}