destroy vehicles
#1

is there a way to let all the cars ingame explode?
Reply
#2

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp(cmdtext, "/exploseallcars", true) == 0)
  {
    for(new vehicleid; vehicleid < MAX_VEHICLES; vehicleid++)
    {
       SetVehicleHealth(vehicleid,1000.0);
       
    }
    return 1;
  }
  return 0;
}
Not tested.
Btw next time use the search button, things like these aren't hard to script.
Reply
#3

Quote:
Originally Posted by Alice[A11
]
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp(cmdtext, "/exploseallcars", true) == 0)
  {
    for(new vehicleid; vehicleid < MAX_VEHICLES; vehicleid++)
    {
       SetVehicleHealth(vehicleid,1000.0);
       
    }
    return 1;
  }
  return 0;
}
Not tested.
Btw next time use the search button, things like these aren't hard to script.
He want's the cars to exploDe (Vehicle Healt 0)

So that makes;
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp(cmdtext, "/explodeallcars", true) == 0)
  {
    for(new vehicleid; vehicleid < MAX_VEHICLES; vehicleid++)
    {
       SetVehicleHealth(vehicleid,0.0);
       
    }
    return 1;
  }
  return 0;
}
Reply
#4

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp(cmdtext, "/explodeallcars", true) == 0)
  {
    for(new vehicleid; vehicleid < MAX_VEHICLES; vehicleid++)
    {
       SetVehicleHealth(vehicleid,0.0);
       
    }
    return 1;
  }
  return 0;
}
Reply
#5

Quote:
Originally Posted by Zeromanster
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp(cmdtext, "/explodeallcars", true) == 0)
  {
    for(new vehicleid; vehicleid < MAX_VEHICLES; vehicleid++)
    {
       SetVehicleHealth(vehicleid,0.0);
       
    }
    return 1;
  }
  return 0;

}
when i read it like that it should work, but, i have an auto repair on my vehicles.
when i type that, does the cars direct explode or does it first goes on fire?, because then i need to take away autorepair.
Reply
#6

pawn Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
    if(strcmp(cmdtext,"/exallcars", true) == 0)
    {
        new Float:p[3];
        for(new v; v<MAX_VEHICLES; v++)
        {
            GetVehiclePos(v,p[0],p[1],p[2]);
            CreateExplosion(p[0],p[1],p[2],12,3);
            DestroyVehicle(v);
        }
        return true;
    }
    return false;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)