Vehicle help...
#1

Alrighty, My dealership system requires that the player needs to enter one of the sales car of the dealership then he types /v buy then the same vehicle spawns at a certain place that i assigned, How can i make it that the player can do /v buy [Vehicleid] and it spawns instead of entering a sales car ?!


Ps: I got everything like the model id prices and spawn place and everything, I just want to know how to make that vehicle id spawning instead of created cars....
Reply
#2

Like a player enters a car, types /v buy and the car they bought spawns at the entrance of the dealership and what not?

All you gotta do is get the coords of the place you want it, and use CreateVehicle. Then, once they buy it use RemovePlayerFromVehicle.
Reply
#3

Dude, I already got the way that they enter a vehicle, let's say the player enters a turismo and types /v buy the vehicle will spawn at the entrance of the dealer, Well i don't want the player to enter a turismo, I want him to type /v buy [Vehicleid] like if he types /v buy 420 He gets a taxi spawned instead of entering the dealership taxi and buys it....
Reply
#4

This could be done via a command dude.
pawn Код:
CMD:v(playerid,params[])
{
    new vehicle,choice[24];
    if(sscanf(params,"s[24]d",choice,vehicle))
    {
        return SendClientMessage(playerid,-1,"USAGE: /v buy [vehicleid]");
    }
    if(!strcmp(choice,"buy",true)) // If they typed buy after /v
    {
        if(vehicleid == INVALID_VEHICLE_ID) // If the vehicle doesn't exist.
        {
            return SendClientMessage(playerid,-1,"ERROR: Invalid vehicle id");
        }
        else
        {
            CreateVehicle(vehicle/* rest of params go here*/);
            // You would then do all your ownership code here
            return 1;
        }
    }
    // You could add more /v options by doing this
    if(!strcmp(choice,"sell",true))
    {
        //code here
        return 1;
    }
    return 1;
}
Is this that what you were looking for?
Reply
#5

Thanks + rep for u


EDIT: undefined symbol : Vehicle id
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)