Crashing when using colors with car
#1

Hi guys, i made everything working, i can use the name of the car , and the id of the car to spawn it.
But when i type like /accar <carid> <color1> <color2> (/accar 522 5 9) the game will just crash.

Anybody know why? The rest works fine.
Heres the code:

pawn Код:
dcmd_accar(playerid, params[])
{
  new VehicleToSpawn = strval(params);
  new SpawnedVeh;

  new str[128];
  new tmp[MAX_STRING];

  if(_LOGIN_Rank[playerid] > 1) {
    if(IsNumeric(params)) {

    }
    else {
      if(sscanf(params, "s", tmp)) {
        SendClientMessage(playerid, COLOR_RED, "No Vehicle Name Given");
      }
      else {
        new Float:x, Float:y, Float:z;
        GetPlayerPos(playerid, x, y, z);
        new Float:Angle;
        GetPlayerFacingAngle(playerid, Angle);
        return SpawnedVeh = CreateVehicle(GetVehicleModelIDFromName(tmp), x + 3 * floatsin(-Angle, degrees), y + 3 * floatcos(-Angle, degrees), z, Angle, 0, 0, 9999999999999999999999999);
      }
    }

                         // 400 t/m 611
    if(VehicleToSpawn > 399 && VehicleToSpawn < 612) {
      new Float:x, Float:y, Float:z;
      GetPlayerPos(playerid, x, y, z);
      new Float:Angle;
      GetPlayerFacingAngle(playerid, Angle);

// printf("%s %d", IsNumeric(params), IsNumeric(params));

      new color1, color2;

      if(sscanf(params, "ddd", VehicleToSpawn, color1, color2)) {
        SpawnedVeh = CreateVehicle(VehicleToSpawn, x + 3 * floatsin(-Angle, degrees), y + 3 * floatcos(-Angle, degrees), z, Angle, 0, 0, 9999999999999999999999999);
      }
      else {
        SpawnedVeh = CreateVehicle(VehicleToSpawn, x + 3 * floatsin(-Angle, degrees), y + 3 * floatcos(-Angle, degrees), z, Angle, color1, color2, 9999999999999999999999999);
      }

// printf("Vehicle ID: %d - Color1: %d - Color 2: %d", VehicleToSpawn, color1, color1, color1, color2, color2, color2);

// new SpawnedVeh = CreateVehicle(VehicleToSpawn, x + 3 * floatsin(-Angle, degrees), y + 3 * floatcos(-Angle, degrees), z, Angle, 0, 0, 9999999999999999999999999);

      if(VehicleToSpawn == 415) {
                         // Upswept Exhaust
        AddVehicleComponent(SpawnedVeh, 1018);
                         // 10x Nitrous
        AddVehicleComponent(SpawnedVeh, 1010);
                         // Win Spoiler
        AddVehicleComponent(SpawnedVeh, 1001);
                         // Right Sideskirt
        AddVehicleComponent(SpawnedVeh, 1007);
                         // Left Sideskirt
        AddVehicleComponent(SpawnedVeh, 1017);
                         // Hydraulics
        AddVehicleComponent(SpawnedVeh, 1087);
      }
      if(VehicleToSpawn == 411) AddVehicleComponent(SpawnedVeh, 1010);
      if(VehicleToSpawn == 568) AddVehicleComponent(SpawnedVeh, 1010);
      if(VehicleToSpawn == 564) PutPlayerInVehicle(playerid, SpawnedVeh, 0);
      if(VehicleToSpawn == 471) AddVehicleComponent(SpawnedVeh, 1010);
    }
    else {
      SendClientMessage(playerid, COLOR_RED, "You Can Only Spawn A Vehicle Between ID 400 And ID 611!");
    }
  }
  return 1;
}
Reply


Messages In This Thread
Crashing when using colors with car - by Robbin237 - 19.04.2009, 12:54
Re: Crashing when using colors with car - by Robbin237 - 19.04.2009, 16:02
Re: Crashing when using colors with car - by Danut - 19.04.2009, 16:06
Re: Crashing when using colors with car - by Robbin237 - 19.04.2009, 16:24
Re: Crashing when using colors with car - by Rks25 - 19.04.2009, 16:26
Re: Crashing when using colors with car - by Robbin237 - 19.04.2009, 18:19
Re: Crashing when using colors with car - by Rks25 - 19.04.2009, 18:20
Re: Crashing when using colors with car - by Robbin237 - 20.04.2009, 12:53
Re: Crashing when using colors with car - by Robbin237 - 20.04.2009, 14:48

Forum Jump:


Users browsing this thread: 2 Guest(s)