Nerdbeere du kommentierst selbst sinnlos eine Frage und meinst was hier zu posten, also musst du nicht versuchen dich aufzublasen..
Zum Thema, man kann jedoch nachfragen ob ein Fahrzeug eine Shotgun für den Spieler besitzt oder nicht, denn wenn man es nachscriptet, kann man es auch abstellen oder?
new bool:gVehicleSpecialAction[MAX_VEHICLES][MAX_PLAYERS];
new gLastVehicleID[MAX_PLAYERS];
forward CheckVehicleSpecialAction(playerid, vehicleid);
stock RemovePlayerWeapon(playerid, weaponid)
{
if(!IsPlayerConnected(playerid) || weaponid < 0 || weaponid > 50) return false;
new saveweapon[13], saveammo[13];
for(new slot = 0; slot < 12; slot++)
GetPlayerWeaponData(playerid, slot, saveweapon[slot], saveammo[slot]);
ResetPlayerWeapons(playerid);
for(new slot; slot < 12; slot++)
{
if(saveweapon[slot] == weaponid || saveammo[slot] == 0) continue;
GivePlayerWeapon(playerid, saveweapon[slot], saveammo[slot]);
}
GivePlayerWeapon(playerid, 0, 1);
return true;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
gVehicleSpecialAction[vehicleid][forplayerid] = true;
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER) gLastVehicleID[playerid] = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_ONFOOT && oldstate == PLAYER_STATE_DRIVER && gVehicleSpecialAction[gLastVehicleID[playerid]][playerid] == true) SetTimerEx("CheckVehicleSpecialAction", 2000, 0, "dd", playerid, gLastVehicleID[playerid]);
return 1;
}
public CheckVehicleSpecialAction(playerid, vehicleid)
{
switch(GetVehicleModel(vehicleid))
{
case 596..598:
{
new weapon, ammo, cw = GetPlayerWeapon(playerid);
GetPlayerWeaponData(playerid, 3, weapon, ammo);
if(weapon == 25)
{
RemovePlayerWeapon(playerid, weapon);
if(ammo > 5) GivePlayerWeapon(playerid, weapon, (ammo-5));
SetPlayerArmedWeapon(playerid, cw);
}
}
}
gVehicleSpecialAction[vehicleid][forplayerid] = false;
return true;
}