21.09.2011, 18:45
how i can make command to delete all cars in the server
if( strcmp( cmdtext, "/deleteallcars", true ) == 0 )
{
for( new veh; veh < MAX_VEHICLES; veh ++ )
{
DestroyVehicle( veh );
}
return 1;
}
|
Code:
if( strcmp( cmdtext, "/deleteallcars", true ) == 0 )
{
for( new veh; veh < MAX_VEHICLES; veh ++ )
{
DestroyVehicle( veh );
}
return 1;
}
|
if( 0 != INVALID_VEHICLE_ID )
{
DestroyVehicle( 0 );
}
if( 1 != INVALID_VEHICLE_ID )
{
DestroyVehicle( 1 );
}
// etc
if( 1999 != INVALID_VEHICLE_ID )
{
DestroyVehicle( 1999 );
}
if( strcmp( cmdtext, "/deleteallcars", true ) == 0 )
{
new Float:X, Float:Y, Float:Z;
for( new veh; veh < MAX_VEHICLES; veh ++ )
{
GetVehiclePos( veh, X, Y, Z );
if( X == 0.00 && Y == 0.00 && Z == 00 )
continue;
DestroyVehicle( veh );
}
return 1;
}
F:\SenjoritaGaming\gamemodes\SanjoritaGaming.pwn(2 675) : error 010: invalid function or declaration F:\SenjoritaGaming\gamemodes\SanjoritaGaming.pwn(2 677) : error 010: invalid function or declaration F:\SenjoritaGaming\gamemodes\SanjoritaGaming.pwn(2 681) : error 010: invalid function or declaration Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
if( strcmp( cmdtext, "/deleteallcars", true ) == 0 )
{
for( new veh; veh < MAX_VEHICLES; veh ++ )
{
if ( veh != INVALID_VEHICLE_ID )
{
DestroyVehicle( veh );
}
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if( strcmp( cmdtext, "/deleteallcars", true ) == 0 )
{
for( new veh; veh < MAX_VEHICLES; veh ++ )
{
if ( veh != INVALID_VEHICLE_ID )
{
DestroyVehicle( veh );
}
}
return 1;
}
return 0;
}