Hey
Mein Tank wird nicht abgezogen , sprich er steht immer auf 100!
forward Tank(playerid);
new Tankmenge[MAX_VEHICLES];
OnGameModeInit
for(new i=0;i<MAX_VEHICLES;i++)
{
Tankmenge[i] = 100;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(GetPlayerVehicleSeat(playerid)==0)
{
SetTimerEx("Tank",7000,1,"i",playerid);
}
return 1;
}
public Tank(playerid)
{
for(new i;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
{
new Wagen = GetPlayerVehicleID(i);
if(motorr[Wagen]==true)
{
if(Tankmenge[Wagen] >= 1)
{
Tankmenge[Wagen]--;
new string[256]; //Das mit dem String war zu testzwecken , die Nachricht wird nicht gesendet!
format(string,sizeof(string),"%d Liter",Tankmenge[Wagen]);
SendClientMessage(playerid,Gelb,string);
}
else
{
motorr[Wagen]=false;
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(Wagen,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(Wagen,false,lights,alarm,doors,bonnet,boot,objective);
}
}
}
}
}
return 1;
}