script help
#3

I guess this is what you're looking for. I've explained my code in comments, tell me if you need further explanation though!
pawn Код:
if(strcmp(cmd, "/descuiemasina", true) == 0)
{
    if(PlayerData[playerid][pMember] == 10 || PlayerData[playerid][pLeader] == 10)
    {
        if(PlayerData[playerid][pRank] >= 5)
        {
            new Float:distance = 12.0; // The maximum range which we check vehicles around
            new Float:X, Y, Z;
            GetPlayerPos(playerid, X, Y, Z);
            new engine,lights,alarm,doors,bonnet,boot,objective;
            for(new i = 0; i < MAX_VEHICLES; i ++) // Loop through all vehicles
            {
                // Ignore invalid vehicles
                if(GetVehicleModel(i) == 0)
                    continue;
                   
                // If this vehicle is actually locked
                if(VehLocked[i] == 1)
                {
                    // This vehicle is locked. Now let's check if it's in the range of this player.
                    if(GetVehicleDistanceFromPoint(i, X, Y, Z) <= distance)
                    {
                        VehLocked[i] = 0;
                        GetVehicleParamsEx(i,engine,lights,alarm,doors,bonnet,boot,objective);
                        SetVehicleParamsEx(i,engine,lights,alarm,0,bonnet,boot,objective);
                    }
                }
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GRAD1, "Nu ai rank 5+!");
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_GRAD1, "Nu esti membru remorcari auto!");
    }
    return 1;
}
Reply


Messages In This Thread
script help - by TheDarkBlade - 17.08.2015, 15:59
Re: script help - by DanielMc - 17.08.2015, 16:16
Re: script help - by [KHK]Khalid - 17.08.2015, 16:31
Re: script help - by arad55 - 17.08.2015, 16:44
Re: script help - by [KHK]Khalid - 17.08.2015, 17:01
Re : script help - by MrAlexisX2 - 17.08.2015, 17:12

Forum Jump:


Users browsing this thread: 1 Guest(s)