Advanced vehicle system problem - 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: Advanced vehicle system problem (
/showthread.php?tid=312051)
Advanced vehicle system problem -
tavos - 19.01.2012
First of all i hope that i posted ok , on the dedicated topic , i didn't get an answer , Second , im running a server with a Godfather script wich i added AVS filterscript , i've got a problem about a SA:MP native witch is not working ,but it exists.When i want to buy i car , i should get in and press YES or NO on a dialog box , but when i press NO , it still let me drive that car , i check'd the pwn file and it gives me the following :
pawn Code:
Код:
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(GetPlayerMoney(playerid) < VehicleValue[id])
{
ShowErrorDialog(playerid, "You don't have enough money to buy this vehicle!");
return 1;
}
new freeid;
for(new i=1; i < MAX_DVEHICLES; i++)
{
if(!VehicleCreated[i])
{
freeid = i; break;
}
}
if(!freeid)
{
ShowErrorDialog(playerid, "Vehicle dealership is out of stock!");
return 1;
}
GivePlayerMoney(playerid, -VehicleValue[id]);
new dealerid = strval(VehicleOwner[id]);
VehicleCreated[freeid] = VEHICLE_PLAYER;
VehicleModel[freeid] = VehicleModel[id];
VehiclePos[freeid] = DealershipPos[dealerid];
VehicleColor[freeid] = VehicleColor[id];
VehicleInterior[freeid] = VehicleInterior[id];
VehicleWorld[freeid] = VehicleWorld[id];
VehicleValue[freeid] = VehicleValue[id];
VehicleOwner[freeid] = PlayerName(playerid);
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;
UpdateVehicle(freeid, 0);
SaveVehicle(freeid);
new msg[128];
format(msg, sizeof(msg), "You have bought this vehicle for $%d", VehicleValue[id]);
SendClientMessage(playerid, COLOR_WHITE, msg);
}
else
{
new vehicleid = GetPVarInt(playerid, "DialogValue1");
if(GetPlayerVehicleAccess(playerid, vehicleid) != 3)
{
RemovePlayerFromVehicle(playerid);
}
}
return 1;
}
This should work right?I've also tryed with TogglePlayerControlablle(playerid, 0);
A solution please?The red text is my problem , it doesn'w work.Thanks a lot