How to set a groups car rank, And creating a despawn saved car.. - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to set a groups car rank, And creating a despawn saved car.. (
/showthread.php?tid=191712)
How to set a groups car rank, And creating a despawn saved car.. -
patfay - 20.11.2010
Well, I have a /setcargroup command and It can only set it to the group. I would like it so you can set the rank to.
For example, I have a Police Rancher. I want to save this Rancher to Group 1 (PD) But, I don't want everyone to drive it. So I want to set it to rank 4. I cannot do this.
Here is the command
pawn Код:
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]");
}
}
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;
}
Now, Whenver I /savecar a car, It says permanently unless I manually delete it from the vehicles file..
I am currently using the Vortex RP script...
I have a command where you can despawn the car, But it still saves into the vehicles file.. I would like a command like /deletecar so it manually deletes the car.
Any help is good!
Re: How to set a groups car rank, And creating a despawn saved car.. -
patfay - 20.11.2010
Anybody?