/rentcar - problem
#1

If I go in car and do /exit + /engine I start rentcar and for free I don't rent it I just start it..how can I make it not start?but I want /exit to work..


PHP код:
if(strcmp(cmd"/rentcar"true) == 0)
                    {
                        if(
IsPlayerConnected(playerid))
                        {
                            for(new 
0sizeof(rentcar); i++)
                            {
                                if(
GetPlayerVehicleID(playerid) == rentcar[i]) continue;
                            }
                            new 
hirefee HireCost(GetPlayerVehicleID(playerid));
                            
/*if(SBizzInfo[1][sbProducts] == 0)
                            {
                                GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
                                return 1;
                            }*/
                            
if(SBizzInfo[0][sbProducts] == 0)
                            {
                                
GameTextForPlayer(playerid"~r~Out Of Stock"50001);
                                return 
1;
                            }
                            if (
GetPlayerCash(playerid) < SBizzInfo[1][sbEntranceCost])
                            {
                                
SendClientMessage(playeridCOLOR_GRAD2"   You dont have that much cash !");
                                return 
1;
                            }
                            if (
GetPlayerCash(playerid) < SBizzInfo[0][sbEntranceCost])
                            {
                                
SendClientMessage(playeridCOLOR_GRAD2"   You dont have that much cash !");
                                return 
1;
                            }
                            if(
HireCar[playerid] != 299)
                            {
                                
gCarLock[HireCar[playerid]] = 0;
                                
UnLockCar(HireCar[playerid]);
                                
SendClientMessage(playeridCOLOR_GREY"Ai deja un vehicol inchiriat,dai /unrentveh,ca sa poti inchiria altceva!");
                                return 
1;
                            }
                            for(new 
i=0i<MAX_PLAYERSi++)
                            {
                                if(
HireCar[i] == GetPlayerVehicleID(playerid))
                                {
                                    
SendClientMessage(playeridCOLOR_GREY" Cineva are deja inchirieata masina asta !");
                                    return 
1;
                                }
                            }
                            
GivePlayerCash(playerid,-SBizzInfo[1][sbEntranceCost]);
                            
SBizzInfo[1][sbTill] += SBizzInfo[1][sbEntranceCost];
                            
ExtortionSBiz(1SBizzInfo[1][sbEntranceCost]);
                            
SBizzInfo[1][sbProducts]--;
                            
//
                            
GivePlayerCash(playerid,-SBizzInfo[0][sbEntranceCost]);
                            
SBizzInfo[0][sbTill] += SBizzInfo[0][sbEntranceCost];
                            
ExtortionSBiz(0SBizzInfo[0][sbEntranceCost]);
                            
SBizzInfo[0][sbProducts]--;
                            
HireCar[playerid] = GetPlayerVehicleID(playerid);
                            
OnPropUpdate();
                            
PlayerPlaySound(playerid10520.00.00.0);
                            
format(stringsizeof(string), "~w~Don't forget to ~r~/unrentveh~n~~g~/lock ~w~to lock your car.",hirefee);
                            
SendClientMessage(playeridCOLOR_RED"Dai /engine ca sa pornesti motorul!");
                            
SendClientMessage(playeridCOLOR_WHITE"Dati /unrentveh ca sa poti inchiria,alt vehicol!");
                            
SendClientMessage(playeridCOLOR_RED"Dai /lock ca sa inchizi/deschizi masina inchiriata.");
                            
GameTextForPlayer(playeridstring50003);
                        }
                        return 
1;
                    } 
Reply
#2

pawn Код:
if(HireCar[playerid] != 299)
                            {
                                gCarLock[HireCar[playerid]] = 0;
                                HireCar[playerid] = GetPlayerVehicleID(playerid);
                                UnLockCar(HireCar[playerid]);
                                SendClientMessage(playerid, COLOR_GREY, "Ai deja un vehicol inchiriat,dai /unrentveh,ca sa poti inchiria altceva!");
                                return 1;
                            }
Apoi la comanda /engine pui:

pawn Код:
for(new i = 0; i < sizeof(rentcar); i++)
{
                                if(GetPlayerVehicleID(playerid) == rentcar[i] && HireCar[playerid] == rentcar[i]) continue;
}
Sau te poti folosi de un stock:

pawn Код:
stock IsARentCar(carid)
{
 for(new i=0;i<sizeof(rentcar);i++)
 {
  if(carid == rentcar[i]) return 1;
 }
 return 0;
}
Atunci poti face la /engine asa:

pawn Код:
if(IsARentCar(GetPlayerVehicleID(playerid) && HireCar[playerid] == GetPlayerVehicleID(playerid))
{
 ......
}
else { return 1; }
Reply
#3

not but there is the freeze thing when I enter rentcar and plaayers do /exit do unfreeze..and go..
Reply
#4

Quote:
Originally Posted by Akcent_Voltaj
Посмотреть сообщение
not but there is the freeze thing when I enter rentcar and plaayers do /exit do unfreeze..and go..
Ok.Adauga la comanda /exit:
RemovePlayerFromVehicle(playerid);
Reply
#5

PHP код:
/exit
{
      
TogglePlayerControllable(playerid1);
      return 
1;
}
/
engine
{
     
TogglePlayerControllable(playerid1); //motorul este pornit!
}
else 
{
      
TogglePlayerControllable(playerid0); //motorul este oprit!

Reply
#6

rezolvat(fixed) Thanks!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)