23.08.2011, 03:15
Well Heres my command
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.!
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;
}