SA-MP Forums Archive
How to create a car that is on the map but locked to someones name? - 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)
+--- Thread: How to create a car that is on the map but locked to someones name? (/showthread.php?tid=351524)



How to create a car that is on the map but locked to someones name? - JAMMIEISFTW - 16.06.2012

How to create a car that is on the map but locked to someones name? Like i create a car but its LOCKED to that specific name.

Or locked to a team like TEAM_ARMY


Re: How to create a car that is on the map but locked to someones name? - JAMMIEISFTW - 16.06.2012

Anyone got a clue?


Re: How to create a car that is on the map but locked to someones name? - JAMMIEISFTW - 16.06.2012

How would i do this?
AddPlayerClass(287,365.5157,2537.5901,16.6640,162. 5553,0,0,0,0,0,0); // This co ord as Maveric
AddPlayerClass(287,393.5299,2446.9619,16.5000,319. 5601,0,0,0,0,0,0); // This Co Ord As Rustler
AddPlayerClass(287,414.3279,2442.6599,16.5000,59.0 561,0,0,0,0,0,0); // This Co Ord As Rustler


Re: How to create a car that is on the map but locked to someones name? - tyler12 - 16.06.2012

check the vehicle id OnPayerEnterVehicle and GePlayerName


Re: How to create a car that is on the map but locked to someones name? - JAMMIEISFTW - 16.06.2012

Example Please?


Re: How to create a car that is on the map but locked to someones name? - KiiD - 16.06.2012

Top of script
Код:
#define team_example   1
new pTeam[MAX_PLAYERS];

new EXAMPLE1;
Код:
EXAMPLE1 = AddStaticVehicleEx(596,1538.6521,-1643.8551,5.6114,0.3763,0,1,100000);
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(IsPlayerInVehicle(playerid, EXAMPLE1) || IsPlayerInVehicle(playerid, EXAMPLE2) || IsPlayerInVehicle(playerid,EXAMPLE))
    {
        SCM(playerid, RED, "you are not part of this group.");
        RemovePlayerFromVehicle(playerid);
    }
    else
    {
        if(pTeam[playerid] == team_example)
        {
            SCM(playerid, GREEN, "/engine to start the vehicle");
        }
    }
    return 1;
}
That should work, haven't tested.