16.01.2012, 17:43
I can't destroy all cars from the map with this. Why?
PHP код:
CMD:vrespawn( playerid, params[ ] )
{
if( PlayerInfo[playerid][pAdmin] < 1 ) return 0;
for( new i=0; i < MAX_PLAYERS; i++ )
if(SpawnedVehicles[playerid] == 1) DestroyVehicle(SpawnedVehicles[i]);
GetPlayerName( playerid, Nam, sizeof Nam );
format( mystring, sizeof mystring, "Admin-Log: %s respawned all cars.", Nam);
SendAdminMessage( COLOR_LIME, mystring );
SendClientMessageToAll(COLOR_CYAN, "All vehicles are respawned!");
return 1;
}
CMD:car(playerid, params[])
{
//unnecessary code removed
new Float:X,Float:Y,Float:Z; new Float:Angle,int1; new LVehicleID = GetPlayerVehicleID(playerid);
GetPlayerPos(playerid, X,Y,Z); GetPlayerFacingAngle(playerid,Angle); int1 = GetPlayerInterior(playerid);
SpawnedVehicles[playerid] = CreateVehicle(car, X,Y,Z, Angle, colour1, colour2, -1); LinkVehicleToInterior(LVehicleID,int1); PutPlayerInVehicle(playerid,SpawnedVehicles[playerid],0);
format(string, sizeof(string), "SYSTEM:{FFFFFF} You spawned a %s", VehicleNames[car-400]);
return SendClientMessage(playerid, COLOR_RED, string);
}