Ingame Vehicle Creator
#8

Quote:
Originally Posted by Jonny5
View Post
try this stock make any command youd like

pawn Code:
stock TryVehicleSpawn(playerid,vModel)
{
    new
        Float:X,
        Float:Y,
        Float:Z,
        Float:A,
        vehicle_id,
        col1,
        col2;

    if (!IsPlayerInAnyVehicle(playerid)){
        col1 = random(129),col2 = random(129);
        GetPlayerPos( playerid, X, Y, Z );
        GetPlayerFacingAngle(playerid, A);
        vehicle_id = CreateVehicle( vModel, X, Y, Z, A,col1,col2,0 );
        LinkVehicleToInterior(vehicle_id, GetPlayerInterior(playerid));
        PutPlayerInVehicle(playerid, vehicle_id, 0);
    }
    else
    {
        SendClientMessage(playerid,0x00FF00AA,"You're already in a vehicle.");
    }
}
this will put the player in the vehicle.

pawn Code:
//usage:

TryVehicleSpawn(playerid,401);
and heres a simple command using sscanf/zcmd.

pawn Code:
CMD:v(playerid,params)
{
    new vModel;
    if (sscanf(params,"i",vModel) return SendClientMessage(playerid,0x00FF00AA,"/v [ModelID]");
    if (400 > vModel > 611) return SendClientMessage(playerid,0x00FF00AA,"/v [ModelID]");
    TryVehicleSpawn(playerid,vModel);
    return 1;
}

EDIT:
and to the guy below, strtok SHOULD NEVER BE USED FOR THIS.
OMG! Bro can you send me a complete pwn of this?? i think your work will gonna work
Reply


Messages In This Thread
Ingame Vehicle Creator - by kbalor - 21.06.2012, 13:27
Re: Ingame Vehicle Creator - by [MM]RoXoR[FS] - 21.06.2012, 13:31
Re: Ingame Vehicle Creator - by Jonny5 - 21.06.2012, 13:39
Re: Ingame Vehicle Creator - by .-.Piero.-. - 21.06.2012, 13:42
Re: Ingame Vehicle Creator - by mickos - 21.06.2012, 13:43
Re: Ingame Vehicle Creator - by kbalor - 21.06.2012, 13:44
Re: Ingame Vehicle Creator - by kbalor - 21.06.2012, 13:48
Re: Ingame Vehicle Creator - by kbalor - 21.06.2012, 13:50
Re: Ingame Vehicle Creator - by .-.Piero.-. - 21.06.2012, 13:52
Re: Ingame Vehicle Creator - by kbalor - 21.06.2012, 13:52

Forum Jump:


Users browsing this thread: 1 Guest(s)