SA-MP Forums Archive
Admin cars - 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: Admin cars (/showthread.php?tid=439455)



Admin cars - [..MonTaNa..] - 25.05.2013

Removed.


Re: Admin cars - Kevin FOx - 25.05.2013

pawn Код:
define this
#define MAX_ADMIN_VEHICLES 1

CMD:adcar(playerid, params[])
{
    new id, Float:pos[4],;
    if(PlayerInfo[playerid][pAdmin] <= 1) return SendClientMessage(playerid, COLOR_GREY, "No autorhiries");
    if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_GREY, "USE: /adcar [vehicleid]");
    if(id < 400 || id > 611) return SendClientMessage(playerid, COLOR_GREY, "Vehicles are between 400 and 611.");
    GetPlayerPos(playerid, position[0], position[1], position[2]);
    GetPlayerFacingAngle(playerid, position[3]);
    for(new i=0; i<MAX_ADMIN_VEHICLES; i++)
    {
        if(!AdmVeh[i])
        {
            AdmVeh[i] = CreateVehicle(id, pos[0], pos[1], pos[2], pos[3], -1, -1, 300);
            i = MAX_ADMIN_VEHICLES;
        }
    }
    return 1;
}
////
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(!ispassenger)
    {
        if(AdmVeh(vehicleid))
        {
            if(PlayerInfo[playerid][pAdmin] <= 1)
            {
                new Float:pos[3];
                GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
                SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
                   SendClientMessage(playerid, COLOR_GREY, "You are not an administrator.");
            }
        }
        }
}