22.02.2011, 01:07
e aew gente aki queria saber como faзo para fazer com que o player que nao e vip possa comprar um carro e o ke e vip mais que um tentei mas o maximo ke consegui foi deixar o ke n e vip comprar varios mas so que que ele compre 1 aew o cmd
if(strcmp(tmp, "comprar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pVIP] < 1)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк nгo й um jogador VIP/VIP Premium");
return 1;
}
for(new i = 0; i < sizeof(CarInfo); i++)
{
if(CarInfo[i][ownedvehicle] == vehid)
{
if(PlayerInfo[playerid][pCarKey] != 0 && PlayerInfo[playerid][pCarKey2] != 0 && PlayerInfo[playerid][pVIP] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " Seu VIP permite que vocк tenha no mбximo dois carros !");
return 1;
}
if(PlayerInfo[playerid][pCarKey] != 0 && PlayerInfo[playerid][pCarKey2] != 0 && PlayerInfo[playerid][pCarKey3] != 0)
{
SendClientMessage(playerid, COLOR_GREY, " Seu VIP Premium permite que vocк tenha no mбximo trкs carros !");
return 1;
}
if(CarInfo[i][cOwned]==1)
{
SendClientMessage(playerid, COLOR_GREY, "Este carro VIP jб tem dono");
return 1;
}
if(PlayerInfo[playerid][pCarKey] == 0)
{
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!", 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");
TogglePlayerControllable(playerid, 1);
SaveCars();
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo tem dinheiro para isso!");
}
return 1;
}
else if(PlayerInfo[playerid][pCarKey2] == 0)
{
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 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");
TogglePlayerControllable(playerid, 1);
SaveCars();
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo tem dinheiro para isso!");
}
return 1;
}
else if(PlayerInfo[playerid][pCarKey3] == 0)
{
if(GetPlayerMoney(playerid) >= CarInfo[i][cValue])
{
PlayerInfo[playerid][pCarKey3] = i+totalveiculosc;
PlayerInfo[playerid][pVeiculo3] = 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");
TogglePlayerControllable(playerid, 1);
SaveCars();
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo tem dinheiro para isso!");
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Erro fatal !");
}
}
}
}
return 1;
}
if(strcmp(tmp, "comprar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pVIP] < 1)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк nгo й um jogador VIP/VIP Premium");
return 1;
}
for(new i = 0; i < sizeof(CarInfo); i++)
{
if(CarInfo[i][ownedvehicle] == vehid)
{
if(PlayerInfo[playerid][pCarKey] != 0 && PlayerInfo[playerid][pCarKey2] != 0 && PlayerInfo[playerid][pVIP] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " Seu VIP permite que vocк tenha no mбximo dois carros !");
return 1;
}
if(PlayerInfo[playerid][pCarKey] != 0 && PlayerInfo[playerid][pCarKey2] != 0 && PlayerInfo[playerid][pCarKey3] != 0)
{
SendClientMessage(playerid, COLOR_GREY, " Seu VIP Premium permite que vocк tenha no mбximo trкs carros !");
return 1;
}
if(CarInfo[i][cOwned]==1)
{
SendClientMessage(playerid, COLOR_GREY, "Este carro VIP jб tem dono");
return 1;
}
if(PlayerInfo[playerid][pCarKey] == 0)
{
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!", 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");
TogglePlayerControllable(playerid, 1);
SaveCars();
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo tem dinheiro para isso!");
}
return 1;
}
else if(PlayerInfo[playerid][pCarKey2] == 0)
{
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 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");
TogglePlayerControllable(playerid, 1);
SaveCars();
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo tem dinheiro para isso!");
}
return 1;
}
else if(PlayerInfo[playerid][pCarKey3] == 0)
{
if(GetPlayerMoney(playerid) >= CarInfo[i][cValue])
{
PlayerInfo[playerid][pCarKey3] = i+totalveiculosc;
PlayerInfo[playerid][pVeiculo3] = 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");
TogglePlayerControllable(playerid, 1);
SaveCars();
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo tem dinheiro para isso!");
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Erro fatal !");
}
}
}
}
return 1;
}