Respawn car command -
Trucker[UK] - 02.08.2011
Anyone know a respawn car command to respawn cars in game
AW: Respawn car command -
Drebin - 02.08.2011
Use SetVehicleToRespawn(vehicleid);
Re: AW: Respawn car command -
Trucker[UK] - 02.08.2011
Quote:
Originally Posted by Drebin
Use SetVehicleToRespawn(vehicleid);
|
can you code it in please
Re: Respawn car command -
sleepysnowflake - 02.08.2011
pawn Код:
// Wherever you need this.
for(new i=1; i<MAX_VEHICLES; i++)
{
if(IsVehicleOccupied(i) == 0)
{
SetVehicleToRespawn(vehicleid);
}
}
pawn Код:
// The stock
stock IsVehicleOccupied(vehicleid)
{
for (new i = 0; i < GetMaxPlayers(); i ++)
{
if (GetPlayerVehicleID(playerid) == vehicleid) return true;
}
return false;
}
Re: Respawn car command -
antonio112 - 02.08.2011
pawn Код:
for(new i=1; i<MAX_VEHICLES; i++)
{
SetVehicleToRespawn(i);
SendClientMessageToAll(-1, "All vehicle respawned by an admin.");
}
Now, you may want to respawn all unocupied vehicles.
Re: Respawn car command -
Trucker[UK] - 02.08.2011
Quote:
Originally Posted by antonio112
pawn Код:
for(new i=1; i<MAX_VEHICLES; i++) { SetVehicleToRespawn(i); SendClientMessageToAll(-1, "All vehicle respawned by an admin."); }
Now, you may want to respawn all unocupied vehicles.
|
i only want the part to resapwn cars that are blocking the road when u do /dl in game u get the id of the vehicle i only want to respawn a certain car
Re: Respawn car command -
Basicz - 02.08.2011
This will respawn a certain vehicle ID you entered.
Requirements : ZCMD + sscanf
pawn Код:
CMD:respawnveh( playerid, params[ ] )
{
if ( !IsPlayerAdmin( playerid ) )
return SendClientMessage( playerid, -1, "ERROR: You aren't a RCON admin." );
static
vehID
;
if ( sscanf( params, "i", vehID ) )
return SendClientMessage( playerid, -1, "SYNTAX: /respawnveh < vehID >" );
if ( vehID == INVALID_VEHICLE_ID )
return SendClientMessage( playerid, -1, "ERROR: Invalid vehicle ID." );
SetVehicleToRespawn( vehID );
SendClientMessage( playerid, -1, "Vehicle has been respawned succesfully." );
return 1;
}
Hope it helps you.
Re: Respawn car command -
Mean - 02.08.2011
Quote:
Originally Posted by Basicz
This will respawn a certain vehicle ID you entered.
Requirements : ZCMD + sscanf
pawn Код:
CMD:respawnveh( playerid, params[ ] ) { if ( !IsPlayerAdmin( playerid ) ) return SendClientMessage( playerid, -1, "ERROR: You aren't a RCON admin." );
static vehID ;
if ( sscanf( params, "i", vehID ) ) return SendClientMessage( playerid, -1, "SYNTAX: /respawnveh < vehID >" );
if ( vehID == INVALID_VEHICLE_ID ) return SendClientMessage( playerid, -1, "ERROR: Invalid vehicle ID." );
SetVehicleToRespawn( vehID );
SendClientMessage( playerid, -1, "Vehicle has been respawned succesfully." );
return 1; }
Hope it helps you.
|
It is not a good idea to use a static here, now you can't make another command containing "new vehID;".
Re: Respawn car command -
Trucker[UK] - 02.08.2011
i tried to make my own here is wat it is
pawn Код:
dcmd_respawnveh(playerid, params[])
{
if(!CmdLevelCheck(playerid,"respawnveh")) return CmdLevelError(playerid,"respawnveh");
new id, tmp[128];
if(sscanf(params, "uz", id, tmp)) return SendClientMessage(playerid, RED, "USAGE: /RESPAWNVEH [ID]");
format(tmp, sizeof tmp, "",Car(id), AdminName(playerid), (tmp[0]) ? ("") : ("."), tmp[0], (tmp[0]) ? (" ]") : (""));
SendClientMessageToAll(YELLOW, tmp), print(tmp), SaveToLog("respawnvehs",tmp), SetInfo(id,"respawnvehs",GetInfo(id,"Respawnvehs")+1);
SendCommandMsg(playerid,"respawnveh");
format(tmp,sizeof(tmp),"",AdminName(playerid));
SpecialLeaveReason[id]=1,PlayerLeaveReason[id]=tmp;
return respawnveh(id);
}
Re: Respawn car command -
Trucker[UK] - 21.09.2011
Instead of respawnveh id can some help me with getveh id please
Thanks