SA-MP Forums Archive
Ayuda de Comando. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: Ayuda de Comando. (/showthread.php?tid=566491)



Ayuda de Comando. - JorgeWest - 06.03.2015

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. - OTACON - 06.03.2015

PHP код:
#include <a_samp>
// **
// **
static
    
Float:PosSpawnVehicles[MAX_VEHICLES][4];
// **
// **
public OnVehicleSpawn(vehicleid){
    
// **
    // **
    
SetVehiclePos(vehicleidPosSpawnVehicles[vehicleid][0], PosSpawnVehicles[vehicleid][1], PosSpawnVehicles[vehicleid][2]);
    
SetVehicleZAngle(vehicleidPosSpawnVehicles[vehicleid][3]);
    
// **
    // **
    
return true;
}
public 
OnPlayerCommandText(playeridcmdtext[]){
    
// **
    // **
    
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(vehicleidPosSpawnVehicles[vehicleid][0], PosSpawnVehicles[vehicleid][1], PosSpawnVehicles[vehicleid][2]);
        
GetVehicleZAngle(vehicleidPosSpawnVehicles[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. - admantis - 06.03.2015

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).