I need help with the AVS FS - 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: I need help with the AVS FS (
/showthread.php?tid=464131)
I need help with the AVS FS -
TonyII - 15.09.2013
Hey guys, I use the AVS FS[Advanced Vehicle System] and my problem is that you can only buy a vehicle from a dealership. How can I turn this dialog into a command for admins so that they can create a certain vehicle for a player?
pawn Код:
if(dialogid == DIALOG_VEHICLE_BUY)
{
if(response)
{
if(GetPlayerVehicles(playerid) >= MAX_PLAYER_VEHICLES)
{
ShowErrorDialog(playerid, "You can't buy any more vehicles! Max: " #MAX_PLAYER_VEHICLES );
return 1;
}
new id = GetPVarInt(playerid, "DialogValue1");
if(GetPlayerCash(playerid) < VehicleValue[id])
{
ShowErrorDialog(playerid, "You don't have enough money to buy this vehicle!");
return 1;
}
new freeid = GetFreeVehicleID();
GivePlayerCash(playerid, -VehicleValue[id]);
VehicleCreated[freeid] = VEHICLE_PLAYER;
VehicleModel[freeid] = VehicleModel[id];
VehicleColor[freeid] = VehicleColor[id];
VehicleInterior[freeid] = VehicleInterior[id];
VehicleWorld[freeid] = VehicleWorld[id];
VehicleValue[freeid] = VehicleValue[id];
GetPlayerName(playerid, VehicleOwner[freeid], sizeof(VehicleOwner[]));
VehicleNumberPlate[freeid] = DEFAULT_NUMBER_PLATE;
for(new d=0; d < sizeof(VehicleTrunk[]); d++)
{
VehicleTrunk[freeid][d][0] = 0;
VehicleTrunk[freeid][d][1] = 0;
}
for(new d=0; d < sizeof(VehicleMods[]); d++)
{
VehicleMods[freeid][d] = 0;
}
VehiclePaintjob[freeid] = 255;
VehicleLock[freeid] = 0;
VehicleAlarm[freeid] = 0;
UpdateVehicle(freeid, 0);
SaveVehicle(freeid);
new msg[128];
format(msg, sizeof(msg), "You have bought this vehicle for %dcp", VehicleValue[id]);
SendClientMessage(playerid, COLOR_WHITE, msg);
}
else
{
new id = GetPVarInt(playerid, "DialogValue1");
if(GetPlayerVehicleAccess(playerid, id) < 1)
{
RemovePlayerFromVehicle(playerid);
}
}
return 1;
}
Re: I need help with the AVS FS -
TonyII - 15.09.2013
Anyone got an idea how to convert this into a cmd?