[Ajuda] Comando comprarcarro
#4

if(strcmp(cmdtext, "/comprarcarro", true) == 0) {
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
for(new carro = 0; carro < MAX_CARROS; carro++)
{
format(string, sizeof(string), "carro%d.ini", carro);
if(strcmp(dini_Get(string, "Dono"), pname, true) == 0){
SendClientMessage(playerid, Vermelho, "Vocк jб tem um carro");
return 1;
}
if(IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleSeat(playerid) == 0 && VehicleID == dini_Int(string, "Id")){
if(GetPlayerGrana(playerid) >= dini_Int(string, "Preco")){
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
dini_IntSet(string, "TDono", 1);
dini_Set(string, "Dono", aname);
SendClientMessage(playerid, Violeta, "(INFO) Veiculo comprado com sucesso!");
SendClientMessage(playerid, Vermelho, "(INFO) Para ver os comandos do veiculo, use: /meucarro");
GivePlayerGrana(playerid, -dini_Int(string, "Preco"));
TogglePlayerControllable(playerid, 1);
return 1;
} else {
SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo tem dinheiro suficiente!");
return 1;
}
}
}
}
Reply


Messages In This Thread
Comando comprarcarro - by DaYviSoN - 07.05.2013, 05:55
Re : Comando comprarcarro - by brunoboy - 07.05.2013, 22:39
Re: Comando comprarcarro - by DaYviSoN - 07.05.2013, 22:44
Re: Comando comprarcarro - by Breno Da Silva Pereira - 07.05.2013, 23:45
Re : Comando comprarcarro - by brunoboy - 08.05.2013, 00:15
Re: Comando comprarcarro - by ProKillerpa - 08.05.2013, 01:23
Re : Comando comprarcarro - by brunoboy - 08.05.2013, 11:03

Forum Jump:


Users browsing this thread: 1 Guest(s)