29.07.2014, 06:15
Hello i have problems, getting /unrentcar command right so here is my rent car command.
and here is the command when i leave the car, under OnPlayerExitVehicle
I dont want it do be like that so i just deleted this,but know i can't unrent it,because can't get unrent command work. Can someone help me?
pawn Код:
CMD:rentcar(playerid, params[])
{
if(GetPlayerState(playerid) == 2)
{
if(GetPlayerCash(playerid) < 9) return SCM(playerid, COLOR_LIGHTRED, "* You do not have enough money.");
SCM(playerid, COLOR_GOLD, "* You have rented this vehicle for $10. Type /engine to start it.");
rentingVehicle[playerid] = true;
GivePlayerCash(playerid, -10);
TogglePlayerControllable(playerid,1);
}
return 1;
pawn Код:
for(new i=0; i<5; i++)
{
if(IsPlayerInVehicle(playerid, rentCAR[i]))
{
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
SCM(playerid, COLOR_GOLD, "* Your car was respawned, to give other players a chance for renting it).");
SetVehicleToRespawn(vehicle);
rentingVehicle[playerid] = false;
TogglePlayerControllable(playerid,1);
}
}
return 1;
}