Hey wie kann ich das hier recoursenfreundlicher schreiben:
(das ist ein laser system)
public OnPlayerUpdate(playerid)
{
if(GetPlayerWeapon(playerid) == 0)
{
RemovePlayerAttachedObject(playerid, 1);
RemovePlayerAttachedObject(playerid, 2);
return 0;
}
if(GetPlayerWeapon(playerid) == 1)
{
RemovePlayerAttachedObject(playerid, 1);
RemovePlayerAttachedObject(playerid, 2);
return 0;
}
if(GetPlayerWeapon(playerid) == 2)
{
RemovePlayerAttachedObject(playerid, 1);
RemovePlayerAttachedObject(playerid, 2);
return 0;
}
if(GetPlayerWeapon(playerid) == 3)
{
RemovePlayerAttachedObject(playerid, 1);
RemovePlayerAttachedObject(playerid, 2);
return 0;
}
if(GetPlayerWeapon(playerid) == 4)
{
RemovePlayerAttachedObject(playerid, 1);
RemovePlayerAttachedObject(playerid, 2);
return 0;
}