13.01.2013, 19:00
o coomando /veiculo comprar
pawn Код:
if(strcmp(tmp, "comprar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pVIP] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк nгo й VIP e nгo pode comprar este carro !");
RemovePlayerFromVehicleEx(playerid);
return true;
}
for(new i = 0; i < sizeof(CarInfo); i++)
{
if(CarInfo[i][ownedvehicle] == vehid)
{
if(PlayerInfo[playerid][pVIP] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк nгo й VIP e nгo pode comprar este carro !");
RemovePlayerFromVehicleEx(playerid);
return true;
}
if(PlayerInfo[playerid][pCarKey] != 0 && PlayerInfo[playerid][pVIP] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "Seu VIP permite que vocк tenha no mбximo 1 carro !");
RemovePlayerFromVehicleEx(playerid);
return true;
}
if(PlayerInfo[playerid][pCarKey] != 0 && PlayerInfo[playerid][pCarKey2] != 0 && PlayerInfo[playerid][pVIP] == 2)
{
SendClientMessage(playerid, COLOR_GREY, "Seu Vip/Premium permite que vocк tenha no mбximo 2 carros !");
RemovePlayerFromVehicleEx(playerid);
return true;
}
if(PlayerInfo[playerid][pLevel] < 2)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк Precisa ter nivel 2 para comprar o veiculo");
RemovePlayerFromVehicleEx(playerid);
return true;
}
if(CarInfo[i][cOwned]==1)
{
SendClientMessage(playerid, COLOR_GREY, "Este carro VIP/Socio jб tem dono");
return true;
}
if(PlayerInfo[playerid][pCarKey] == 0)
{
if(PlayerInfo[playerid][pVIP] < 1)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк nгo й um jogador VIP");
RemovePlayerFromVehicleEx(playerid);
return true;
}
if(GetPlayerMoney(playerid) >= CarInfo[i][cValue])
{
PlayerInfo[playerid][pCarKey] = i+totalveiculosc;
PlayerInfo[playerid][pVeiculo] = i;
CarInfo[i][cOwned] = 1;
CarOffered[playerid]=0;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(CarInfo[i][cOwner], sendername, 0, strlen(sendername), 999);
GivePlayerMoney(playerid,-CarInfo[i][cValue]);
GameTextForPlayer(playerid, "~w~Parabens~n~Voce comprou esse Carro VIP!", 5000, 3);
PlayerPlaySound(playerid, 1147, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_GRAD2, "parabens pela sua compra !");
SendClientMessage(playerid, COLOR_GRAD2, "USE: /veiculo ajuda para ver os comandos");
Controle(playerid, 1);
SaveCars();
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo tem dinheiro para isso!");
RemovePlayerFromVehicleEx(playerid);
}
return true;
}
else if(PlayerInfo[playerid][pCarKey2] == 0)
{
if(PlayerInfo[playerid][pSocio] < 1)
{
SendClientMessage(playerid, COLOR_GREY, "Apenas Sуcio podem ter dois carros vips.");
RemovePlayerFromVehicleEx(playerid);
return true;
}
if(GetPlayerMoney(playerid) >= CarInfo[i][cValue])
{
PlayerInfo[playerid][pCarKey2] = i+totalveiculosc;
PlayerInfo[playerid][pVeiculo2] = i;
CarInfo[i][cOwned] = 1;
CarOffered[playerid]=0;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(CarInfo[i][cOwner], sendername, 0, strlen(sendername), 999);
GivePlayerMoney(playerid,-CarInfo[i][cValue]);
GameTextForPlayer(playerid, "~w~Parabens~n~Voce comprou esse Carro Premium!", 5000, 3);
PlayerPlaySound(playerid, 1147, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_GRAD2, "parabens pela sua compra !");
SendClientMessage(playerid, COLOR_GRAD2, "USE: /veiculo ajuda para ver os comandos");
Controle(playerid, 1);
SaveCars();
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo tem dinheiro para isso!");
RemovePlayerFromVehicleEx(playerid);
}
return true;
}
}
}
}
return true;
}