#1

Hi all im trying to make cmd /car for spawn a vehicle,
this the cmd, http://pastebin.com/z2Z2uvW4 ,it's working but i want make when you type /car carid, you will be automatic driver
Reply
#2

You have it

PHP код:
PutPlayerInVehicle(playeridvehicle0); 
just change it to
PHP код:
PutPlayerInVehicle(playeridvehicle1); 
I dont promise just try
Reply
#3

Quote:
Originally Posted by salev13
Посмотреть сообщение
You have it

PHP код:
PutPlayerInVehicle(playeridvehicle0); 
just change it to
PHP код:
PutPlayerInVehicle(playeridvehicle1); 
I dont promise just try


not work :/
Reply
#4

Try to make half a second timer, see if that'll work.
Reply
#5

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[200], idx;
    cmd = strtok(cmdtext, idx);

    if(!strcmp(cmd, "/car", true))
    {
        new tmp[256];
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, l_red, "You don't put the vehicle name");
        new vehicle = GetVehicleModelIDFromName(tmp);
        if(!(400 <= vehicle <= 611)) return SendClientMessage(playerid, l_red, "That vehicle name was not found");
        new Float:a, Float:x, Float:y, Float:z, String[45];
        GetPlayerFacingAngle(playerid, a);
        GetPlayerPos(playerid, x, y, z);
        GetXYInFrontOfPlayer(playerid, x, y, (IsPlayerInAnyVehicle(playerid)) ? (8) : (5));
        new pveh = CreateVehicle(vehicle, x, y, z, a, -1, -1, 1);
        LinkVehicleToInterior(pveh, GetPlayerInterior(playerid));
        PutPlayerInVehicle(playerid, pveh, 0);
        format(String, sizeof(String), "You have spawned a %s", aVehicleNames[vehicle - 400]);
        SendClientMessage(playerid, l_green, String);
        return 1;
    }
    return 0;
}
You were doing:
pawn Код:
PutPlayerInVehicle(playerid, vehicle, 0);
You were supposed to do:
pawn Код:
PutPlayerInVehicle(playerid, PlayersVehicle, 0);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)