SA-MP Forums Archive
small command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: small command (/showthread.php?tid=222732)



small command - Yourfatness - 08.02.2011

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.


Re: small command - Tee - 08.02.2011

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


Re: small command - Backwardsman97 - 08.02.2011

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


Re: small command - Yourfatness - 08.02.2011

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.


Re: small command - Antonio [G-RP] - 08.02.2011

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


Re: small command - Backwardsman97 - 08.02.2011

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


Re: small command - Yourfatness - 08.02.2011

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.


Re: small command - Ash. - 08.02.2011

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.


Re: small command - MadeMan - 08.02.2011

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?


Re: small command - Yourfatness - 09.02.2011

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.