Posts: 58
Threads: 12
Joined: Jun 2012
I have bought a database for IBP gamemode , I scripted a lot on it and now the '/v park' command doesn't work. This is the scenary :
- I buy a car from Commerce Dealership, I 'call' it, enter vehicle, '/v buypark' , and then when I write '/v park' .. SURPRISE ! No response , and the car is not despawned. Please help me.
Posts: 200
Threads: 23
Joined: Dec 2007
Reputation:
0
Links to the game modes in question would always be handy for those wishing to help you. Then again, if you're using a certain game modes feature - you really need to take it up with the writer of that game mode.
Posts: 58
Threads: 12
Joined: Jun 2012
This is the command :
Код:
if(strcmp(x_vehicle, "park", true) == 0)
{
if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTRED, "You are not in a vehicle !");
return 1;
}
new plname[MAX_PLAYER_NAME];
GetPlayerName(playerid, plname, sizeof(plname));
new vehi = GetPlayerVehicleID(playerid);
if(PlayerInfo[playerid][pCarKey] == vehi || vehi == PlayerInfo[playerid][pCarKey] || (strcmp(plname, VehicleInfo[vehi][vOwner], true) == 0))
{
return 1;
}
new Float:vehicleHealth;
GetVehicleHealth(vehi, vehicleHealth);
if(vehicleHealth < 350)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "Your car is near death, you cannot park it.");
return 1;
if(PlayerToPoint(1.0, playerid, VehicleInfo[vehi][vX], VehicleInfo[vehi][vY], VehicleInfo[vehi][vZ]))
{
if(VehicleInfo[vehi][vNeon] != 0)
{
DestroyObject(VehicleInfo[vehi][vNeon2]);
DestroyObject(VehicleInfo[vehi][vNeon]);
VehicleInfo[vehi][vNeon2] = 0;
VehicleInfo[vehi][vNeon] = 0;
}
SaveVehicles(playerid, vehi);
SendClientMessage(playerid, COLOR_GREEN, "Your vehicle is parked (despawned).");
PlayerInfo[playerid][pCarKey] = 0;
VehicleInfo[vehi][vOwned] = 0;
DestroyVehicle(vehi);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "You need to be in your park place!");
SendClientMessage(playerid, COLOR_WHITE, "Your parking place is marked on the map now.");
SetPlayerCheckpoint(playerid, VehicleInfo[PlayerInfo[playerid][pCarKey]][vX], VehicleInfo[PlayerInfo[playerid][pCarKey]][vY], VehicleInfo[PlayerInfo[playerid][pCarKey]][vZ], 5.0);
VCP[playerid] = 1;
ActiveCP[playerid] = 1;
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "You don't own this vehicle !");
return 1;
}
}
Posts: 58
Threads: 12
Joined: Jun 2012
Posts: 200
Threads: 23
Joined: Dec 2007
Reputation:
0
Well the "problem" is pretty obvious - code you want to be executed isn't being executed because the rest of the code isn't letting the script engine get to it... This is where debugging and testing methods come in real handy.
Posts: 58
Threads: 12
Joined: Jun 2012
So , please you can help me ? Please.
Skype : robert.andrei979 / Yahoo: boss.andrei70