SA-MP Forums Archive
Scripting SD only cars + colors - 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: Scripting SD only cars + colors (/showthread.php?tid=410446)



- izeatfishz - 25.01.2013

Alright so ima map some sd cars and i need to know how i actually script them in so only sd can use them and script the colors?

also how would i remove any cars already scripted in as i cant see them on my map editor


AW: Scripting SD only cars + colors - Blackazur - 25.01.2013

I dont understand so right your Question, have you on your Script something like:

Quote:

AddStaticVehicle

?


Re: Scripting SD only cars + colors - Sime30 - 25.01.2013

AddStaticVehicle(modelid, x coordinate, y coordinate, z coordinate, angle, color1, color2);
This ?



Re: Scripting SD only cars + colors - izeatfishz - 25.01.2013

yh but how do i make it so only sd can enter and if a normal guy tries to enter he cant and it says summit likie you are not in this faction and only people in the faction can enter?


Re: Scripting SD only cars + colors - Vince - 25.01.2013

Define 'sd' ?


Re: Scripting SD only cars + colors - Sime30 - 25.01.2013

Here, this one is when he tries to enter to block him entering...

pawn Код:
new CopCar[1]; // one car for an example
// OnGameModeInit
CopCar[0] = AddStaticVehicleEx(428, 1544.2725830078, -1684.3175048828, 5.8806247711182, 90, 0, 1,300); //Securicar 1
// ============
forward IsACopCar(carid);
public IsACopCar(carid)
{
    for(new i = 0; i < sizeof(CopCar); i++)
    {
        if(carid == CopCar[i])  return 1;
    }
    return 0;
}

// under OnPlayerEnterVehicle

if (IsACopCar(vehicleid) && !ispassenger)
        {
            if(PlayerInfo[playerid][pLeader]==1 || PlayerInfo[playerid][pMember]==1) {}
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "You're not in PD!");
                new Float:cx, Float:cy, Float:cz;
                GetPlayerPos(playerid, cx, cy, cz);
                SetPlayerPos(playerid, cx,  cy, cz);
            }
        }