Weird crash, if I add something
#1

Working:
pawn Код:
public DashUpdate(playerid)
{
      new vehid = GetPlayerVehicleID(playerid);
      new estring[7];
      switch(EngineStatus[vehid])
      {
         case 0: estring = "Off";
         case 1: estring = "On";
         default: estring = "Broken";
      }
      new tstring[300];
      format(tstring,sizeof(tstring),"Engine: %s~n~Fuel: %d~n~Speed: %d KM" , estring, Fuel[vehid], GetVehicleSpeed(vehid));
      TextDrawSetString(Dash[playerid], tstring);
      TextDrawHideForPlayer(playerid,Dash[playerid]);
      TextDrawShowForPlayer(playerid,Dash[playerid]);
     return 1;
}
Not Working:
pawn Код:
public DashUpdate(playerid)
{
    new State = GetPlayerState(playerid);
    if(State == PLAYER_STATE_DRIVER && IsPlayerInAnyVehicle(playerid))
    {
      new vehid = GetPlayerVehicleID(playerid);
      new estring[7];
      switch(EngineStatus[vehid])
      {
         case 0: estring = "Off";
         case 1: estring = "On";
         default: estring = "Broken";
      }
      new tstring[300];
      format(tstring,sizeof(tstring),"Engine: %s~n~Fuel: %d~n~Speed: %d KM" , estring, Fuel[vehid], GetVehicleSpeed(vehid));
      TextDrawSetString(Dash[playerid], tstring);
      TextDrawHideForPlayer(playerid,Dash[playerid]);
      TextDrawShowForPlayer(playerid,Dash[playerid]);
    }
    else
    {
       TextDrawHideForPlayer(playerid,Dash[playerid]);
       KillTimer(DashUpdate(playerid));
    }
    return 1;
}
Why is the not-working one causing the server to crash, and how can I fix it. This is really confusing
Reply


Messages In This Thread
Weird crash, if I add something - by Memoryz - 30.09.2010, 22:39
Re: Weird crash, if I add something - by -Sneaky- - 30.09.2010, 22:55
Re: Weird crash, if I add something - by [XST]O_x - 30.09.2010, 22:56
Re: Weird crash, if I add something - by -Sneaky- - 30.09.2010, 23:01
Re: Weird crash, if I add something - by [XST]O_x - 30.09.2010, 23:05
Re: Weird crash, if I add something - by Memoryz - 30.09.2010, 23:07
Re: Weird crash, if I add something - by -Sneaky- - 30.09.2010, 23:07
Re: Weird crash, if I add something - by Memoryz - 01.10.2010, 00:47

Forum Jump:


Users browsing this thread: 3 Guest(s)