Ayuda de Comando. -
Bueno, os preguntaba si sabiais el comando comъn de respawnear autos para la gente. (Roleplay). Se los agradecerнa mucho ya que llevo mucho tempo buscando el comando. Gracias.
Respuesta: Ayuda de Comando. -
PHP код:
#include <a_samp>
// **
// **
static
Float:PosSpawnVehicles[MAX_VEHICLES][4];
// **
// **
public OnVehicleSpawn(vehicleid){
// **
// **
SetVehiclePos(vehicleid, PosSpawnVehicles[vehicleid][0], PosSpawnVehicles[vehicleid][1], PosSpawnVehicles[vehicleid][2]);
SetVehicleZAngle(vehicleid, PosSpawnVehicles[vehicleid][3]);
// **
// **
return true;
}
public OnPlayerCommandText(playerid, cmdtext[]){
// **
// **
if(strcmp(cmdtext, "/respawnear", true) == 0){
new
vehicleid = GetPlayerVehicleID(playerid);
if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid, -1, "INFO: no te encuentras en un vehiculo.");
if(GetPlayerState(playerid)!=PLAYER_STATE_DRIVER)return SendClientMessage(playerid, -1, "INFO: no te encuentras conductor del vehiculo.");
GetVehiclePos(vehicleid, PosSpawnVehicles[vehicleid][0], PosSpawnVehicles[vehicleid][1], PosSpawnVehicles[vehicleid][2]);
GetVehicleZAngle(vehicleid, PosSpawnVehicles[vehicleid][3]);
SetVehicleToRespawn(vehicleid);
SendClientMessage(playerid, -1, "INFO: haz respawneado tu vehiculo, ahora renacera en esta posicion.");
return true;
}
// **
// **
return false;
}
Re: Ayuda de Comando. -
Por quй almacenar la posiciуn inicial del vehнculo si SetVehicleToRespawn ya lo coloca en su posiciуn original por defecto? Quй cуdigo tan redundante. A menos que tu intenciуn sea respawnearlo en la misma posiciуn y eso no tiene propуsito (ni es lo que el post original ha pedido).