22.10.2010, 23:51
vк se isso te ajuda :
pawn Код:
forward Aluguel(carid);
pawn Код:
if(Aluguel(newcar))
{
if (HireCar[playerid] != newcar)
{
format(string, sizeof(string), "~w~Voce pode alugar este carro~n~Preco:~g~R$%d~n~~w~Para alugar digite ~g~/alugarcarro~w~~n~para sair digite ~r~/sair",SBizzInfo[0][sbEntranceCost]);
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, string, 5000, 3);
}
}
if(Aluguel(newcar))
{
if (HireCar[playerid] != newcar)
{
format(string, sizeof(string), "~w~Voce pode alugar este carro~n~Preco:~g~R$%d~n~~w~Para alugar digite ~g~/alugarcarro~w~~n~para sair digite ~r~/sair",SBizzInfo[1][sbEntranceCost]);
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, string, 5000, 3);
}
}
pawn Код:
if(strcmp(cmd, "/alugarcarro", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new Veh = GetPlayerVehicleID(playerid);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s Estб alugando um carro!.", sendername);
DetectorProx(20.0,playerid,string,ROXO);
if(Aluguel(Veh))
{
new hirefee = HireCost(GetPlayerVehicleID(playerid));
if(Aluguel(Veh))
{
if(PlayerInfo[playerid][pPbiskey] == 0)
{
GameTextForPlayer(playerid, "~w~Cuidado Com o carro", 5000, 3);
TogglePlayerControllable(playerid, 1);
return 1;
}
if (GetPlayerMoneyEx(playerid) < SBizzInfo[0][sbEntranceCost])
{
SendClientMessage(playerid, COLOR_GRAD2, " Vocк nгo tem dinheiro suficiente para aluga este carro !");
return 1;
}
GivePlayerMoneyEx(playerid,-SBizzInfo[0][sbEntranceCost]);
SBizzInfo[0][sbTill] += SBizzInfo[0][sbEntranceCost];
ExtortionSBiz(0, SBizzInfo[0][sbEntranceCost]);
}
if(GetPlayerVehicleID(playerid) >= 165 && GetPlayerVehicleID(playerid) <= 169)
{
if(PlayerInfo[playerid][pPbiskey] == 1)
{
GameTextForPlayer(playerid, "~w~Cuidado Com o carro", 5000, 3);
TogglePlayerControllable(playerid, 1);
return 1;
}
if (GetPlayerMoneyEx(playerid) < SBizzInfo[1][sbEntranceCost])
{
SendClientMessage(playerid, COLOR_GRAD2, " Vocк nгo tem dinheiro suficiente para aluga este carro !");
return 1;
}
GivePlayerMoneyEx(playerid,-SBizzInfo[1][sbEntranceCost]);
SBizzInfo[1][sbTill] += SBizzInfo[1][sbEntranceCost];
ExtortionSBiz(1, SBizzInfo[1][sbEntranceCost]);
}
if(HireCar[playerid] != 299)
{
gCarLock[HireCar[playerid]] = 0;
UnLockCar(HireCar[playerid]);
}
HireCar[playerid] = GetPlayerVehicleID(playerid);
OnPropUpdate();
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~ Alugado, para trancar digite ~y~/trancar ~n~ ~p~ cuide bem do nosso carro",hirefee);
TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid, string, 5000, 3);
}
}
return 1;
}
pawn Код:
public Aluguel(carid)
{
if((carid >= 173 ) && (carid <= 185))
{
return 1;
}
return 0;
}