/getcar cmd
#1

I. Have been loocking for a /getcar cmd.
Could someone help with that cmd plz.
Reply
#2

What do you mean by getcar, a command that creates a vehicle? anyway you should use the search button or the request thread, also, could be easier if you post more informations such as which command proccessor do you use.
Reply
#3

pawn Код:
CMD:getcar(playerid, params[])
{
    new carid;
    if(sscanf(params, "i", carid)) return SendClientMessage(playerid, ~1, "USAGE: /getcar [carid]");
    if(carid > MAX_VEHICLES) return SendClientMessage(playerid, ~1, "That  vehicle does not exists.");
    new Float: gPos[3];
    GetPlayerPos(playerid, gPos[0], gPos[1], gPos[2]);
    SetVehiclePos(carid, gPos[0] + 2, gPos[1], gPos[2]);
    return 1;
}
Reply
#4

By getcar are you trying to create a car, or just find one?
Reply
#5

to get a car, an already existing car
Reply
#6

pawn Код:
CMD:getvehicle(playerid, params[])
{
    new vehicleid;
    if(sscanf(params, "i", vehicleid)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /getvehicle [vehicleid]");
    if(GetVehicleModel(vehicleid) == 0 || vehicleid >= MAX_VEHICLES) return SendClientMessage(playerid, COLOR_RED, "That  vehicle does not exist.");
    new Float:playerPos[3];
    GetPlayerPos(playerid, playerPos[0], playerPos[1], playerPos[2]);
    GetXYInFrontOfPlayer(playerid, playerPos[0], playerPos[1], 5.0);
    SetVehiclePos(vehicleid, playerPos[0], playerPos[1], playerPos[2]);
    return 1;
}

GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
    new Float:a;
    GetPlayerPos(playerid, x, y, a);
    GetPlayerFacingAngle(playerid, a);
    if(GetPlayerVehicleID(playerid)) GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
    x += (distance * floatsin(-a, degrees));
    y += (distance * floatcos(-a, degrees));
}
Not tested.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)