[Ajuda] Comando Criar veiculo
#1

tenho um comando de criar carros pela id , mais tem q ter as cordenadas, e demora muita eu pegar pra poder criar 1 veiculo alguem pode edita ele pra mim ?

pawn Код:
COMMAND:veiculo(playerid, params[])
{
// Setup local variables
new VehicleModel, vID, Msg[128], Float:x, Float:y, Float:z, Float:Angle, SpawnDelay;

// Send the command to all admins so they can see it
SendAdminText(playerid, "/veiculo", params);

// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player's admin-level is at least 5
if (APlayerData[playerid][PlayerLevel] >= 5)
{
if (sscanf(params, "iffffi", VehicleModel, x, y, z, Angle, SpawnDelay)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/vehicle <VehicleModel> <x> <y> <z> <Angle> <SpawnDelay>\"");
else
{
// Spawn the vehicle at the location specified by the player (also set max-fuel and save the model for the vehicle)
vID = Vehicle_Create(VehicleModel, x, y, z, Angle, random(126), random(126), SpawnDelay);
// Inform the player about it
format(Msg, 128, "Voce Criou o Veiculo %i (model-id = %i) at coords: x=%4.2f, y=%4.2f, z=%4.2f", vID, VehicleModel, x, y, z);
SendClientMessage(playerid, 0x00FF00FF, Msg);
}
}
else
return 0;
}
else
return 0;

// Let the server know that this was a valid command
return 1;
}
Reply
#2

pawn Код:
COMMAND:veiculo(playerid, params[])
{
    new VehicleModel, vID, Msg[128], Float:Pos[3];
    SendAdminText(playerid, "/veiculo", params);
    if (APlayerData[playerid][LoggedIn] == true)
    {
        if (APlayerData[playerid][PlayerLevel] >= 5)
        {
            if (sscanf(params, "i", VehicleModel,)) reutnr SendClientMessage(playerid, 0xFF0000AA, "Usage: vehicle <VehicleModel> ");
           
            GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
            vID = Vehicle_Create(VehicleModel, Pos[0], Pos[1], Pos[2], 0, random(126), random(126), -1);
            format(Msg, 128, "Voce Criou o Veiculo %i (model-id = %i) at coords: ", vID, VehicleModel);
            SendClientMessage(playerid, 0x00FF00FF, Msg);
        }
    }
    return 1;
}
Reply
#3

Deve funcionar, fiz bem rapidin. Usa como base

pawn Код:
COMMAND:veiculo( playerid, params[] ) {
    new
        IDVeh,
        Pos [ 3 ]
    ;
    if ( sscanf ( params , "i" , IDVeh ) )
        return SendClientMessage ( playerid , -1 , "[ERRO]: /veiculo [id]" );

    GetPlayerPos ( playerid, Pos [ 0 ], Pos [ 1 ], Pos [ 2 ] );
    CreateVehicle ( IDVeh , Pos [ 0 ], Pos [ 1 ], Pos [ 2 ], 0, 0, 0, 9999 );
    return 1;
}
Reply
#4

+Rep Pros 2 Obrigado !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)