Need help with SetCargroup CMD
#1

Well Heres my command
pawn Code:
command(setcargroup, playerid, params[])
{
    new id, string[128];
    if(sscanf(params, "d", id))
    {
        if(Player[playerid][AdminLevel] >= 1)
        {
            SendClientMessage(playerid, WHITE, "SYNTAX: /setcargroup [Group ID] [Group Rank]");
        }
    }
    else
    {
        if(Player[playerid][AdminLevel] >= 4)
        {
            if(IsPlayerInAnyVehicle(playerid))
            {
                if(id >= 0 && id < MAX_GROUPS)
                {
                    if(GetVehicleFileID(GetPlayerVehicleID(playerid))  == 0)
                    {
                        SendClientMessage(playerid, WHITE, "That doesn't seem to be a saved vehicle.");
                    }
                    else
                    {
                        if(id == 0)
                        {
                            SendClientMessage(playerid, WHITE, "You have unlocked this vehicle.");
                            Vehicles[GetVehicleFileID(GetPlayerVehicleID(playerid))][CarGroup] = 0;
                        }
                        else
                        {
                            Vehicles[GetVehicleFileID(GetPlayerVehicleID(playerid))][CarGroup] = id;
                            format(string, sizeof(string), "You have locked this vehicle to Group %s.", Groups[id][GroupName]);
                            SendClientMessage(playerid, WHITE, string);
                            SaveExistingVehicle(GetPlayerVehicleID(playerid));
                        }
                    }
                }
                else
                {
                    format(string, sizeof(string), "Invalid Group ID (groups vary from ID 1 to ID %d).", MAX_GROUPS);
                    SendClientMessage(playerid, WHITE, string);
                }
            }
            else
            {
                SendClientMessage(playerid, WHITE, "You're not in a valid vehicle.");
            }
        }
    }
    return 1;
}
Its from VXRP 1 script, How would I make it so a player in a faction is REQUIRED to be a certain rank to drive it, and to set that certain rank on the /setcargroup, thanks.!
Reply


Messages In This Thread
Need help with SetCargroup CMD - by Azzeto - 23.08.2011, 03:15
Re: Need help with SetCargroup CMD - by =WoR=Varth - 23.08.2011, 03:24
Re: Need help with SetCargroup CMD - by Azzeto - 23.08.2011, 03:30
Re: Need help with SetCargroup CMD - by =WoR=Varth - 24.08.2011, 07:39

Forum Jump:


Users browsing this thread: 1 Guest(s)