[Ayuda]Al spawnear un auto
#1

Hola amigos, les quiero pedir una ayuda es sobre el comando /V que esta en el filterscript fsdebug.
Quiero que, al usar el comando saque el auto, y cuando vuelva a usar el comando borre el otro auto que habia sacado, para que no se llene de autos, me entienden?
Gracias de ante mano, saludos!
Reply
#2

pawn Код:
new vehiculo[MAX_PLAYERS];

if(vehiculo[playerid] >= 0)
{
DestroyVehicle(vehiculo[playerid]);
vehiculo[playerid] = CreateVehicle(modelid,x,y,z,r,color1,color2,-1);
return 1;
}
Reply
#3

Gracias! pero donde agrego eso? perdуn, soy novato :/
Reply
#4

pawn Код:
dcmd_v(playerid, params[])
{
    new
        idx,
        iString[ 128 ];

    if ( gPlayerStatus[ playerid ] != 0 )
    {
        format              ( iString, 128, "[ERROR]: You are already using \"%s\".", aSelNames[ gPlayerStatus[ playerid ] - 1 ] );
        SendClientMessage   ( playerid, COLOR_RED, iString );

        return true;
    }

    if ( params[ 0 ] == '\0' )  // Same effect as a !strlen check.
        return SendClientMessage( playerid, COLOR_RED, "[USAGE]: /v MODELID/NAME or /vehicle MODELID/NAME" );

    //***************
    // Fix by Mike! *
    //***************

    idx = GetVehicleModelIDFromName( params );

    if( idx == -1 )
    {
        idx = strval(iString);

        if ( idx < MIN_VEHI_ID || idx > MAX_VEHI_ID )
            return SendClientMessage(playerid, COLOR_RED, "[ERROR]: Invalid MODELID/NAME");
    }
   
    if(curPlayerVehI[playerid] >= 0)
    {
    DestroyVehicle(curPlayerVehI[playerid]);
    new
        Float:x,
        Float:y,
        Float:z,
        Float:a;

    GetPlayerPos(playerid, x, y, z);
    GetXYInFrontOfPlayer(playerid, x, y, VEHI_DIS);
    GetPlayerFacingAngle(playerid, a);

    curPlayerVehM[playerid] = idx;

    curPlayerVehI[playerid] = CreateVehicle(idx, x, y, z + 2.0, a + 90.0, -1, -1, 5000);
    LinkVehicleToInterior(curPlayerVehI[playerid], GetPlayerInterior(playerid));

    curServerVehP[curPlayerVehI[playerid]][spawn]   = true;
    curServerVehP[curPlayerVehI[playerid]][vmodel]  = idx;
    curServerVehP[curPlayerVehI[playerid]][vInt]    = GetPlayerInterior(playerid);

    format(iString, 128, "[SUCCESS]: Spawned a \"%s\" (MODELID: %d, VEHICLEID: %d)", aVehicleNames[idx - MIN_VEHI_ID], idx, curPlayerVehI[playerid]);

    SendClientMessage(playerid, COLOR_GREEN, iString);
    return 1;
    }
    return true;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)