Vehicle system integrated in gamemode, doesnt work
#1

Hello folks,

Today i tried to integrate Cali-Cars: Advanced vehicle ownership! in the SFCRRPG script i'm using...
But i can't get it to work properly.

If you buy a car, it does spawn it, but when i /park it, and the vehicle respawns (ex: explosion), it does not respawn, or respawn at the dealership (depends what i try, in the script), but i can't get it to spawn at the last /park location.

Also, it does not remove any money from the player, who buys a vehicle.

Here is some of my code:
pawn Код:
GivePlayerMoney(playerid,-79500);
                SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have purchased an Infernus from Otto's Cars for $79500.");
                dini_Create(file);
                VehicleInfo[playerid][Model] = 411;
                VehicleInfo[playerid][Price] = 79500;
                VehicleInfo[playerid][CarX] = -1649.8687;
                VehicleInfo[playerid][CarY] = 1218.8984;
                VehicleInfo[playerid][CarZ] = 7.0115;
                VehicleInfo[playerid][CarRot] = 224.3334;
                Vehicle[playerid] = CreateVehicle(411,VehicleInfo[playerid][CarX],VehicleInfo[playerid][CarY],VehicleInfo[playerid][CarZ],VehicleInfo[playerid][CarRot],VehicleInfo[playerid][colora],VehicleInfo[playerid][colorb],3600000);
                VehicleInfo[Vehicle[playerid]][bought] =playerid;
                gPlayerHasCar[playerid] = 1;
                RemovePlayerFromVehicle(playerid);
                OwnerID[Vehicle[playerid]] = playerid;
                VehPlate[Vehicle[playerid]] = "XYZR 000";
                PutPlayerInVehicle(playerid, Vehicle[playerid], 0);
This is the code where the player buys the vehicle (Its in a dialog)

If you need more code to help me out, i'll get it ASAP.
Reply
#2

This is most probably due to your gamemode having a variable for money. Meaning it's safer and better in almost all ways. The current way of giving money(in your filterscript) is the normal way, which means that they do not come together. You must only use one way, either deleting the variable that contains money and use giveplayermoney or the other way around.


The park issue can be due to you already having a similar command or something that interfers with the process of parking it. Basically similar to the money problem.
Reply
#3

No it does not, i basicly merged the old vehicle system of SFCRRPG together with the Cali Cars, basicly resulting in the code above.

Also, there is no other park command, i know enough about scripting to not make mistakes like that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)