Problema com o comando /alugarmoto -
escolano - 24.08.2013
Quando eu alugo a moto, as pessoas nгo conseguem da a ingnicгo no veiculo. Tem que sair do veiculo e depois entrar para ligar. Alguйm sabe onde errei nesse comando?
Eu acho que pode ser esses 3 linhas aqui.
PHP код:
gEngine[playerid] = 1;
engineOn[GetPlayerVehicleID(playerid)] = false;
//TogglePlayerControllable(playerid, 1);
COMANDO "/alugarmoto"
PHP код:
if(strcmp(cmd, "/alugarmoto", true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < sizeof(rentcar); i++)
{
if(GetPlayerVehicleID(playerid) == rentcar[i]) continue;
}
new hirefee = HireCost(GetPlayerVehicleID(playerid));
if(SBizzInfo[1][sbProducts] == 0)
{
GameTextForPlayer(playerid, "~r~Fora de estoque", 5000, 1);
return 1;
}
if (GetPlayerMoney(playerid) < SBizzInfo[1][sbEntranceCost])
{
SendClientMessage(playerid, COLOR_GRAD2, " Voce nao tem dinheiro !");
return 1;
}
if(HireCar[playerid] != 299)
{
gCarLock[HireCar[playerid]] = 0;
UnLockCar(HireCar[playerid]);
SendClientMessage(playerid, COLOR_GREY, "Vocк precisa desalugar seu carro/moto/barco atual primeiro !");
return 1;
}
for(new i=0; i<MAX_PLAYERS; i++)
{
if(HireCar[i] == GetPlayerVehicleID(playerid))
{
SendClientMessage(playerid, COLOR_GREY, " Alguem alugou esse carro !");
return 1;
}
}
/*if(PlayerInfo[playerid][pPbiskey] == 1)
{
GameTextForPlayer(playerid, "~w~No charge for the boss", 5000, 3);
TogglePlayerControllable(playerid, 1);
return 1;
}*/
SafeGivePlayerMoney(playerid,-SBizzInfo[1][sbEntranceCost]);
SBizzInfo[1][sbTill] += SBizzInfo[1][sbEntranceCost];
ExtortionSBiz(1, SBizzInfo[1][sbEntranceCost]);
SBizzInfo[1][sbProducts]--;
HireCar[playerid] = GetPlayerVehicleID(playerid);
OnPropUpdate(3,1);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~Nao esqueca de usar ~r~/desalugarmoto~n~~g~/trancar ~w~para fechar o carro.",hirefee);
SendClientMessage(playerid, COLOR_YELLOW2, "Voce pode dar a inginicao !");
gEngine[playerid] = 1;
engineOn[GetPlayerVehicleID(playerid)] = false;
//TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid, string, 5000, 3);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /alugarmoto",d,m,y,h,mi,s,sendername);
CommandLog(string);
}
return 1;
}
Re: Problema com o comando /alugarmoto -
PT - 24.08.2013
tenta trocar isto
pawn Код:
engineOn[GetPlayerVehicleID(playerid)] = false;
por
pawn Код:
engineOn[GetPlayerVehicleID(playerid)] = true;
Re: Problema com o comando /alugarmoto -
escolano - 24.08.2013
Continua a mesma coisa, eu fico na moto e ela nгo da a inginiзгo...
Re: Problema com o comando /alugarmoto -
focaximubh - 24.08.2013
Nгo entendo de RPG mas dк uma olhada na CallBack OnPlayerEnterVehicle pode ser que o erro esteja lб.
Re: Problema com o comando /alugarmoto -
escolano - 24.08.2013
Jб olhei, modifiquei e nada, a moto sу da ingniзгo quando coloco /sair e entro de novo, nгo entendo pq depois de alugar a moto ela nгo libere para eu da a ingniзгo... agora complicou..
Re: Problema com o comando /alugarmoto -
darkxdll - 24.08.2013
Talvez tente usar
SetVehicleParamsEx
no comando que deve funcionar .
Re: Problema com o comando /alugarmoto -
escolano - 24.08.2013
Vou testar e jб te falo... se vai funcionar
Re: Problema com o comando /alugarmoto -
PT - 24.08.2013
seguindo a logica do dark tenta isto
pawn Код:
if(strcmp(cmd, "/alugarmoto", true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < sizeof(rentcar); i++)
{
if(GetPlayerVehicleID(playerid) == rentcar[i]) continue;
}
new hirefee = HireCost(GetPlayerVehicleID(playerid));
if(SBizzInfo[1][sbProducts] == 0)
{
GameTextForPlayer(playerid, "~r~Fora de estoque", 5000, 1);
return 1;
}
if (GetPlayerMoney(playerid) < SBizzInfo[1][sbEntranceCost])
{
SendClientMessage(playerid, COLOR_GRAD2, " Voce nao tem dinheiro !");
return 1;
}
if(HireCar[playerid] != 299)
{
gCarLock[HireCar[playerid]] = 0;
UnLockCar(HireCar[playerid]);
SendClientMessage(playerid, COLOR_GREY, "Vocк precisa desalugar seu carro/moto/barco atual primeiro !");
return 1;
}
for(new i=0; i<MAX_PLAYERS; i++)
{
if(HireCar[i] == GetPlayerVehicleID(playerid))
{
SendClientMessage(playerid, COLOR_GREY, " Alguem alugou esse carro !");
return 1;
}
}
SafeGivePlayerMoney(playerid,-SBizzInfo[1][sbEntranceCost]);
SBizzInfo[1][sbTill] += SBizzInfo[1][sbEntranceCost];
ExtortionSBiz(1, SBizzInfo[1][sbEntranceCost]);
SBizzInfo[1][sbProducts]--;
HireCar[playerid] = GetPlayerVehicleID(playerid);
OnPropUpdate(3,1);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_YELLOW2, "Voce pode dar a inginicao !");
gEngine[playerid] = 1;
format(string, sizeof(string), "~w~Nao esqueca de usar ~r~/desalugarmoto~n~~g~/trancar ~w~para fechar o carro.",hirefee);
GameTextForPlayer(playerid, string, 5000, 3);
new engine, lights, alarm, doors, bonnet, boot, objective, y, m, d, h,mi,s;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /alugarmoto",d,m,y,h,mi,s,sendername);
CommandLog(string);
}
return 1;
}
Re: Problema com o comando /alugarmoto -
escolano - 24.08.2013
Deu 2 erros.
(47820) : error 017: undefined symbol "vehicleid"
PHP код:
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
(47821) : error 017: undefined symbol "vehicleid"
PHP код:
SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
Re: Problema com o comando /alugarmoto -
PT - 24.08.2013
esqueci 1 coisa
tenta assim
pawn Код:
if(strcmp(cmd, "/alugarmoto", true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < sizeof(rentcar); i++)
{
if(GetPlayerVehicleID(playerid) == rentcar[i]) continue;
}
new hirefee = HireCost(GetPlayerVehicleID(playerid));
if(SBizzInfo[1][sbProducts] == 0)
{
GameTextForPlayer(playerid, "~r~Fora de estoque", 5000, 1);
return 1;
}
if (GetPlayerMoney(playerid) < SBizzInfo[1][sbEntranceCost])
{
SendClientMessage(playerid, COLOR_GRAD2, " Voce nao tem dinheiro !");
return 1;
}
if(HireCar[playerid] != 299)
{
gCarLock[HireCar[playerid]] = 0;
UnLockCar(HireCar[playerid]);
SendClientMessage(playerid, COLOR_GREY, "Vocк precisa desalugar seu carro/moto/barco atual primeiro !");
return 1;
}
for(new i=0; i<MAX_PLAYERS; i++)
{
if(HireCar[i] == GetPlayerVehicleID(playerid))
{
SendClientMessage(playerid, COLOR_GREY, " Alguem alugou esse carro !");
return 1;
}
}
SafeGivePlayerMoney(playerid,-SBizzInfo[1][sbEntranceCost]);
SBizzInfo[1][sbTill] += SBizzInfo[1][sbEntranceCost];
ExtortionSBiz(1, SBizzInfo[1][sbEntranceCost]);
SBizzInfo[1][sbProducts]--;
HireCar[playerid] = GetPlayerVehicleID(playerid);
OnPropUpdate(3,1);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_YELLOW2, "Voce pode dar a inginicao !");
gEngine[playerid] = 1;
format(string, sizeof(string), "~w~Nao esqueca de usar ~r~/desalugarmoto~n~~g~/trancar ~w~para fechar o carro.",hirefee);
GameTextForPlayer(playerid, string, 5000, 3);
new engine, lights, alarm, doors, bonnet, boot, objective, y, m, d, h,mi,s, vehicleid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /alugarmoto",d,m,y,h,mi,s,sendername);
CommandLog(string);
}
return 1;
}