small command
#1

this command is supposed to put me in a car. i made it into a filterscript so i could load and use it because a car was stuck where nobody could ever get to it. it worked, but sometimes it doesnt work. randomly, it will decide not to put me in a car.
i commented out the string length check (because im still not sure how to use it) but i still cant get this command to work every time.
Reply
#2

Should it put you into a car that is near you or it should create a car then put you in it?
Reply
#3

Are you trying to get into a certain vehicle id or a certain player's vehicle id? If it's the second one, use this.

http://pastebin.com/kwHJsnNj
Reply
#4

it's not supposed to be a vehicle near me and it has nothing to do with other players. it's supposed to put me in the vehicleid i input no matter where i am in relation to the vehicle.
Reply
#5

I've experienced problems with PutPlayerInVehicle.. does it not work in sa-mp 0.3c?
Reply
#6

It always works fine for me. Are you sure you're typing in valid vehicle ids? They start at 1, not 0.
Reply
#7

i am sure i used valid ids, i had 3 cars in a triangle around me and was using /dl. it works when it wants to work. that's why i asked for help.
Reply
#8

Just try putting yourself in vehicle id 0. (PutPlayerInVehicle(playerid, 0, 0)) - In that command, then you will know if the command is executing correctly.
Reply
#9

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[64];
    new tmp[128];
    new idx;
    cmd = strtok(cmdtext,idx);
    if(strcmp("/getvehicle", cmd, true) == 0)
    {
        if(IsPlayerAdmin(playerid))
        {
            tmp = strtok(cmdtext,idx);
            if(!strlen(tmp) || strlen(tmp) > 11) {return SendClientMessage(playerid,0xFFFFFFFF,"Usage: /getvehicle (id)");}
            new id = strval(tmp);
            PutPlayerInVehicle(playerid,id,0);
        }
        return 1;
    }
    return 0;
}
Are you RCON admin when using it?
Reply
#10

yes i am admin. after seeing it work and not leaving the server and then having it not work, i wondered why and posted here. i think it has something to do with my code.

@funky1234: using id 0 didnt work. i then tried 1857 (i was standing right next to it) and it worked, but i couldnt repeat it. this is the problem. it doesnt work every time.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)