16.09.2011, 13:59
Ae queria uma ajuda, pois no meu gm os alugueis de veiculos estao por comando ai queria tipo assim :
aparecer a dialog quando entrar no veiculo com a mensagem : vc deseja alugar este veiculo ...se ele clicar em Sim executa o comando /alugarveiculo e clicar em nгo /sair
nгo sei se vai precisar do meu cmd /alugarcarro masi ta ai:
aparecer a dialog quando entrar no veiculo com a mensagem : vc deseja alugar este veiculo ...se ele clicar em Sim executa o comando /alugarveiculo e clicar em nгo /sair
nгo sei se vai precisar do meu cmd /alugarcarro masi ta ai:
PHP код:
if(strcmp(cmd, "/alugarcarro", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new newcar = GetPlayerVehicleID(playerid);
if((GetPlayerVehicleID(playerid) >= 332 && GetPlayerVehicleID(playerid) <= 351) || (GetPlayerVehicleID(playerid) >= 182 && GetPlayerVehicleID(playerid) <= 193)
|| (GetPlayerVehicleID(playerid) >= 505 && GetPlayerVehicleID(playerid) <= 510) || (GetPlayerVehicleID(playerid) >= 352 && GetPlayerVehicleID(playerid) <= 379))
{
new hirefee = HireCost(GetPlayerVehicleID(playerid));
if (GetPlayerMoney (playerid) < SBizzInfo[1][sbEntranceCost])
{
SendClientMessage(playerid, COLOR_GRAD2, "Vocк nгo tem esse dinheiro !");
return 1;
}
if(HireCar[playerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк tem que desalugar o outro veiculo !");
return 1;
}
for(new i=0; i<MAX_PLAYERS; i++)
{
if(HireCar[i] == GetPlayerVehicleID(playerid))
{
SendClientMessage(playerid, COLOR_GREY, "Alguem jб alugou esse veiculo !");
TogglePlayerControllable(playerid, 1);
RemovePlayerFromVehicleEx(playerid);
return 1;
}
}
GivePlayerMoney(playerid,-SBizzInfo[1][sbEntranceCost]);
SBizzInfo[1][sbTill] += SBizzInfo[1][sbEntranceCost];
ExtortionSBiz(1, SBizzInfo[1][sbEntranceCost]);
HireCar[playerid] = GetPlayerVehicleID(playerid);
OnPropUpdate();
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~Voce pode ~r~/desalugarcarro~n~~g~ou /trancar ~w~ para trancar o carro.",hirefee);
TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid, string, 5000, 3);
return 1;
}
else if((GetPlayerVehicleID(playerid) >= 194 && GetPlayerVehicleID(playerid) <= 202) || (GetPlayerVehicleID(playerid) >= 225 && GetPlayerVehicleID(playerid) <= 230))
{
new hirefee = HireCost(GetPlayerVehicleID(playerid));
if (GetPlayerMoney (playerid) < SBizzInfo[20][sbEntranceCost])
{
SendClientMessage(playerid, COLOR_GRAD2, "Vocк nгo tem esse dinheiro !");
return 1;
}
if(HireCar[playerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк tem que desalugar o outro veiculo !");
return 1;
}
for(new i=0; i<MAX_PLAYERS; i++)
{
if(HireCar[i] == GetPlayerVehicleID(playerid))
{
SendClientMessage(playerid, COLOR_GREY, "Alguem jб alugou esse veiculo !");
TogglePlayerControllable(playerid, 1);
RemovePlayerFromVehicleEx(playerid);
return 1;
}
}
GivePlayerMoney(playerid,-SBizzInfo[19][sbEntranceCost]);
SBizzInfo[19][sbTill] += SBizzInfo[19][sbEntranceCost];
ExtortionSBiz(19, SBizzInfo[19][sbEntranceCost]);
HireCar[playerid] = GetPlayerVehicleID(playerid);
OnPropUpdate();
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~Voce pode ~r~/desalugarcarro~n~~g~ou /trancar ~w~ para trancar o carro.",hirefee);
TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid, string, 5000, 3);
return 1;
}
else if((newcar >= 231 && newcar <= 235) || (newcar >= 511 && newcar <= 515) || (newcar >= 521 && newcar <= 527) || (newcar >= 600 && newcar <= 602)
|| (newcar >= 324 && newcar <= 331) || newcar == 455 || newcar == 519 || (newcar >= 476 && newcar <= 484))
{
new hirefee = HireCost(GetPlayerVehicleID(playerid));
if (GetPlayerMoney (playerid) < SBizzInfo[21][sbEntranceCost])
{
SendClientMessage(playerid, COLOR_GRAD2, "Vocк nгo tem esse dinheiro !");
return 1;
}
if(HireCar[playerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк tem que desalugar o outro veiculo !");
return 1;
}
for(new i=0; i<MAX_PLAYERS; i++)
{
if(HireCar[i] == GetPlayerVehicleID(playerid))
{
SendClientMessage(playerid, COLOR_GREY, "Alguem jб alugou esse veiculo !");
TogglePlayerControllable(playerid, 1);
RemovePlayerFromVehicleEx(playerid);
return 1;
}
}
GivePlayerMoney(playerid,-SBizzInfo[20][sbEntranceCost]);
SBizzInfo[20][sbTill] += SBizzInfo[20][sbEntranceCost];
ExtortionSBiz(20, SBizzInfo[20][sbEntranceCost]);
HireCar[playerid] = GetPlayerVehicleID(playerid);
OnPropUpdate();
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~Voce pode ~r~/desalugarcarro~n~~g~ou /trancar ~w~ para trancar o carro.",hirefee);
TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid, string, 5000, 3);
return 1;
}
else if(carroVIP(newcar))
{
new hirefee = HireCost(GetPlayerVehicleID(playerid));
if (GetPlayerMoney (playerid) < SBizzInfo[23][sbEntranceCost])
{
SendClientMessage(playerid, COLOR_GRAD2, "Vocк nгo tem esse dinheiro !");
return 1;
}
if(HireCar[playerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк tem que desalugar o outro veiculo !");
return 1;
}
for(new i=0; i<MAX_PLAYERS; i++)
{
if(HireCar[i] == GetPlayerVehicleID(playerid))
{
SendClientMessage(playerid, COLOR_GREY, "Alguem jб alugou esse veiculo !");
TogglePlayerControllable(playerid, 1);
RemovePlayerFromVehicleEx(playerid);
return 1;
}
}
GivePlayerMoney(playerid,-SBizzInfo[22][sbEntranceCost]);
SBizzInfo[22][sbTill] += SBizzInfo[22][sbEntranceCost];
ExtortionSBiz(22, SBizzInfo[22][sbEntranceCost]);
HireCar[playerid] = GetPlayerVehicleID(playerid);
OnPropUpdate();
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~Voce pode ~r~/desalugarcarro~n~~g~ou /trancar ~w~ para trancar o carro.",hirefee);
TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid, string, 5000, 3);
return 1;
}
}
return 1;
}
if(strcmp(cmd, "/alugarheli", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if((GetPlayerVehicleID(playerid) >= 596 && GetPlayerVehicleID(playerid) <= 599) || (GetPlayerVehicleID(playerid) >= 407 && GetPlayerVehicleID(playerid) <= 419)
|| GetPlayerVehicleID(playerid) == 485 || GetPlayerVehicleID(playerid) == 486 || GetPlayerVehicleID(playerid) == 503 || GetPlayerVehicleID(playerid) == 504)
{
new hirefee = HireCost(GetPlayerVehicleID(playerid));
if (GetPlayerMoney (playerid) < SBizzInfo[19][sbEntranceCost])
{
SendClientMessage(playerid, COLOR_GRAD2, "Vocк nгo tem esse dinheiro !");
return 1;
}
if(HireCar[playerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк tem que desalugar o outro veiculo !");
return 1;
}
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(HireCar[i] == GetPlayerVehicleID(playerid))
{
SendClientMessage(playerid, COLOR_GREY, "Alguem jб alugou esse veiculo !");
TogglePlayerControllable(playerid, 1);
RemovePlayerFromVehicleEx(playerid);
return 1;
}
}
}
GivePlayerMoney(playerid,-SBizzInfo[18][sbEntranceCost]);
SBizzInfo[18][sbTill] += SBizzInfo[18][sbEntranceCost];
ExtortionSBiz(18, SBizzInfo[18][sbEntranceCost]);
HireCar[playerid] = GetPlayerVehicleID(playerid);
OnPropUpdate();
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~Voce pode ~r~/desalugarheli~n~~g~ou /trancar ~w~ para trancar o heli.",hirefee);
TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid, string, 5000, 3);
return 1;
}
}
return 1;
}
if(strcmp(cmd, "/desalugarcarro", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(HireCar[playerid] != 299)
{
new idcar = GetPlayerVehicleID(playerid);
if(idcar == HireCar[playerid])
{
TogglePlayerControllable(playerid, 1);
}
SetVehicleToRespawn(HireCar[playerid]);
VTrancado[HireCar[playerid]] = 0;
UnLockCar(HireCar[playerid]);
HireCar[playerid] = 0;
GameTextForPlayer(playerid, "~w~Voce desalugou o carro", 5000, 3);
}
}
return 1;
}