SA-MP Forums Archive
help jobs - 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: help jobs (/showthread.php?tid=479854)



help jobs - Deividasltu - 07.12.2013

Hello all I would like to require such lessons as assigned machine work there say he practiced medicine and can only vazuoti with the machine


Re: help jobs - Deividasltu - 07.12.2013

up my topic


Re: help jobs - PrivatioBoni - 07.12.2013

Can you please rephrase your question? At the moment, it does not make that much sense and is hard for us to read.


Re: help jobs - Deividasltu - 07.12.2013

Quote:
Originally Posted by PrivatioBoni
Посмотреть сообщение
Can you please rephrase your question? At the moment, it does not make that much sense and is hard for us to read.
I want to make the machine would be assigned to work


Re: help jobs - batonsa - 07.12.2013

I would go about creating static vehicles and adding stocks like IsACopCar, IsAnAmbulance, IsAFiretruck, etc.

This must go under OnGameModeInit:
Код:
AddStaticVehicleEx ( 416, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 15 );//ambulance 1 (random position with colors 0 and 1, set to respawn after 15 seconds when not used)
AddStaticVehicleEx ( 416, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 15 );//ambulance 2 (same as above)
This can go anywhere:
Код:
stock IsAnAmbulance(vehicleid)
{
    switch(vehicleid):
    {
        case 1: true;
        case 2: true;
    }
    return 1;
}
And under OnPlayerEnterVehicle call (if you don't have it add it):

Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(IsAnAmbulance(vehicleid) && !medic(playerid) == 1//Assign it either to a job or a faction or whatever)
    {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, 0xFFFFFFFF, "This vehicle is only for medics!");
    }
}
I'm just too lazy to explain any further at the moment ^^