Can someone make this?
#1

Hi, Before you all say "Use the Search Button", i would like to say, i have, and couldnt find anything about this

IF YOU FIND ANYTHING PLEASE LINK..
But can someone please make me a

/lock, and /unlock command for vehicles?

I want it in zcmd or sccanf format

so:

COMMMAND:lock

or CMD:lock.

Please anyone? will pay 15 cents in paypal for whoever helps.
Reply
#2

Just make one yourself. Save you 15 cents. There's a tutorial about switching vehicle params.
Reply
#3

Its not about switching

Its that, i dont know shit about scripting

and i need someone to make it for me

Im payin them 15 cents Lol.

I really cbf to make it myself :/

My scripter isnt on right now. so..
Reply
#4

http://************/42c529q
Reply
#5

That doesnt help.
Reply
#6

https://sampforum.blast.hk/showthread.php?tid=245967
Reply
#7

Well, the first thing you need is a vehicle ownership ... You can always use a filterscript ... which is the best solution to be honest. Here are some, which I recommend using ...

http://forum.sa-mp.com/showthread.ph...icle+Ownership - Credits California
http://forum.sa-mp.com/showthread.ph...icle+Ownership - Credits [L3th4l]
http://forum.sa-mp.com/showthread.ph...icle+Ownership - Credits RaFsTar
Reply
#8

Array at the top of your gamemode:
pawn Код:
new
    PlayerWhoLocked[MAX_VEHICLES] = {INVALID_PLAYER_ID, ...};
Command to lock the vehicle:
pawn Код:
CMD:lock(playerid, params[])
{
    new
        vehicleid = GetPlayerVehicleID(playerid);
       
    if(!vehicleid) return SendClientMessage(playerid, 0xFFFFFFFF, "* You are not in a vehicle!");
    else
    {
        PlayerWhoLocked[vehicleid] = playerid;
        for(new i = 0; i < MAX_PLAYERS; ++ i)
        {
            if(i == playerid) continue;
            else SetVehicleParamsForPlayer(vehicleid, i, 0, 1);
        }
        SendClientMessage(playerid, 0xFFFFFFFF, "* You have locked this car!");
    }
    return 1;
}
Command to unlock the vehicle:
pawn Код:
CMD:unlock(playerid, params[])
{
    new
        vehicleid = GetPlayerVehicleID(playerid);
       
    if(!vehicleid) return SendClientMessage(playerid, RED, "* You are not in a vehicle!");
    else
    {
        PlayerWhoLocked[vehicleid] = INVALID_PLAYER_ID;
        for(new i = 0; i < MAX_PLAYERS; ++ i)
            SetVehicleParamsForPlayer(vehicleid, i, 0, 0);
        SendClientMessage(playerid, 0xFFFFFFFF, "* You have unlocked this car!");
    }
    return 1;
}
Callback needed to re-lock the vehicle when it is streamed:
pawn Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
    if((PlayerWhoLocked[vehicleid] != INVALID_PLAYER_ID) &&
    (PlayerWhoLocked[vehicleid] == forplayerid))
        SetVehicleParamsForPlayer(vehicleid, forplayerid, 0, 1);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)