else if(strcmp(x_job,"carrocompra",true) == 0)
{
if(OwnableCarOffer[playerid] < 999)
{
if(OwnableCarID[playerid] == 0) { return 1; }
if(OwnableCarPrice[playerid] == 0 || OwnableCarPrice[playerid] > 1500000) { return 1; }
if(OwnableCarID[playerid] == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey]) { }
else if(OwnableCarID[playerid] == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2]) { }
else { SendClientMessage(playerid, COLOR_GREY, " A oferta nгo estб mais disponнvel"); return 1; }
if(GetPlayerMoney(playerid) >= OwnableCarPrice[playerid])
{
if(IsPlayerConnected(OwnableCarOffer[playerid]))
{
GetPlayerName(OwnableCarOffer[playerid], giveplayer, sizeof(giveplayer));
if(PlayerInfo[playerid][pPcarkey] == 999)
{
if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey])
{
PlayerInfo[playerid][pPcarkey] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey];
PlayerInfo[OwnableCarOffer[playerid]][pPcarkey] = 999;
}
else if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2])
{
PlayerInfo[playerid][pPcarkey] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2];
PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2] = 999;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " O Vendedor do veнculo precisa estar nesse veнculo !");
return 1;
}
format(string, sizeof(string), "* Vocк comprou um carro por R$%d de %s.",OwnableCarPrice[playerid],giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* %s comprou seu carro por R$%d.",sendername,OwnableCarPrice[playerid]);
SendClientMessage(OwnableCarOffer[playerid], COLOR_WHITE, string);
SafeRemovePlayerFromVehicle(OwnableCarOffer[playerid]);
SafeGivePlayerMoney(playerid, - OwnableCarPrice[playerid]);
SafeGivePlayerMoney(OwnableCarOffer[playerid], OwnableCarPrice[playerid]);
strmid(CarInfo[OwnableCarID[playerid]][cOwner], sendername, 0, strlen(sendername), 999);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Vocк jб tem um carro ! ");
return 1;
}
DateProp(playerid);
DateProp(OwnableCarOffer[playerid]);
OnPropUpdate();
OnPlayerUpdateEx(playerid);
OnPlayerUpdateEx(OwnableCarOffer[playerid]);
OwnableCarOffer[playerid] = 999;
OwnableCarID[playerid] = 0;
OwnableCarPrice[playerid] = 0;
GameTextForPlayer(playerid, "~w~Parabens~n~Nao se esqueca de /v estacionar!", 5000, 3);
SendClientMessage(playerid, COLOR_GRAD2, "Parabens na sua nova compra!");
SendClientMessage(playerid, COLOR_GRAD2, "Digite /ajudaveiculo para ver a ajuda de veнculo!");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Vendedor do carro estб Offline !");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Ninguйm lhe ofereceu um carro !");
return 1;
}
}
else if(strcmp(x_job,"carrocompra",true) == 0)
{
if(OwnableCarOffer[playerid] < 999)
{
if(OwnableCarID[playerid] == 0) { return 1; }
if(OwnableCarPrice[playerid] == 0 || OwnableCarPrice[playerid] > 1500000) { return 1; }
if(OwnableCarID[playerid] == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey]) { }
else if(OwnableCarID[playerid] == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2]) { }
else { SendClientMessage(playerid, COLOR_GREY, " A oferta nгo estб mais disponнvel"); return 1; }
if(GetPlayerMoney(playerid) >= OwnableCarPrice[playerid])
{
if(IsPlayerConnected(OwnableCarOffer[playerid]))
{
GetPlayerName(OwnableCarOffer[playerid], giveplayer, sizeof(giveplayer));
if(PlayerInfo[playerid][pPcarkey] == 999)
{
if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey])
{
PlayerInfo[playerid][pPcarkey] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey];
PlayerInfo[OwnableCarOffer[playerid]][pPcarkey] = 999;
}
else if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2])
{
PlayerInfo[playerid][pPcarkey] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2];
PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2] = 999;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " O Vendedor do veнculo precisa estar nesse veнculo !");
return 1;
}
format(string, sizeof(string), "* Vocк comprou um carro por R$%d de %s.",OwnableCarPrice[playerid],giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* %s comprou seu carro por R$%d.",sendername,OwnableCarPrice[playerid]);
SendClientMessage(OwnableCarOffer[playerid], COLOR_WHITE, string);
SafeRemovePlayerFromVehicle(OwnableCarOffer[playerid]);
SafeGivePlayerMoney(playerid, - OwnableCarPrice[playerid]);
SafeGivePlayerMoney(OwnableCarOffer[playerid], OwnableCarPrice[playerid]);
strmid(CarInfo[OwnableCarID[playerid]][cOwner], sendername, 0, strlen(sendername), 999);
}
if(PlayerInfo[playerid][pPcarkey2] == 999)
{
if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey])
{
PlayerInfo[playerid][pPcarkey] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey];
PlayerInfo[OwnableCarOffer[playerid]][pPcarkey] = 999;
}
else if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2])
{
PlayerInfo[playerid][pPcarkey] = PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2];
PlayerInfo[OwnableCarOffer[playerid]][pPcarkey2] = 999;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " O Vendedor do veнculo precisa estar nesse veнculo !");
return 1;
}
format(string, sizeof(string), "* Vocк comprou um carro por R$%d de %s.",OwnableCarPrice[playerid],giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* %s comprou seu carro por R$%d.",sendername,OwnableCarPrice[playerid]);
SendClientMessage(OwnableCarOffer[playerid], COLOR_WHITE, string);
SafeRemovePlayerFromVehicle(OwnableCarOffer[playerid]);
SafeGivePlayerMoney(playerid, - OwnableCarPrice[playerid]);
SafeGivePlayerMoney(OwnableCarOffer[playerid], OwnableCarPrice[playerid]);
strmid(CarInfo[OwnableCarID[playerid]][cOwner], sendername, 0, strlen(sendername), 999);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Vocк jб tem um carro ! ");
return 1;
}
DateProp(playerid);
DateProp(OwnableCarOffer[playerid]);
OnPropUpdate();
OnPlayerUpdateEx(playerid);
OnPlayerUpdateEx(OwnableCarOffer[playerid]);
OwnableCarOffer[playerid] = 999;
OwnableCarID[playerid] = 0;
OwnableCarPrice[playerid] = 0;
GameTextForPlayer(playerid, "~w~Parabens~n~Nao se esqueca de /v estacionar!", 5000, 3);
SendClientMessage(playerid, COLOR_GRAD2, "Parabens na sua nova compra!");
SendClientMessage(playerid, COLOR_GRAD2, "Digite /ajudaveiculo para ver a ajuda de veнculo!");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Vendedor do carro estб Offline !");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Ninguйm lhe ofereceu um carro !");
return 1;
}
}
if(strcmp(cmd, "/darchaves", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); new car; if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD1, "USE: /darchaves [id]"); return 1; } giveplayerid = ReturnUser(tmp); if(HireCar[playerid] == 299 && PlayerInfo[playerid][pPHousekey] == 255) { SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo tem uma chave para dar"); return 1; } else { if(HireCar[playerid] != 299 && SwitchKey[playerid] == 0) { car = HireCar[playerid]; VTrancado[car] = 0; UnLockCar(car); HireCar[playerid] = 299; } else { car = PlayerInfo[playerid][pPHousekey]+totalveiculos; } } if (IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { if(ProxDetectorS(5.0, playerid, giveplayerid)) { if(HireCar[giveplayerid] != 299) { VTrancado[HireCar[giveplayerid]] = 0; UnLockCar(HireCar[giveplayerid]); } HireCar[giveplayerid] = car; HireCar[playerid] = 999; GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), " Vocк deu a chave do seu veiculo para %s", giveplayer); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); SendClientMessage(playerid, COLOR_GRAD1, string); format(string, sizeof(string), " Vocк recebeu a chave do veiuclo de %s", sendername); SendClientMessage(giveplayerid, COLOR_GRAD1, string); format(string, sizeof(string), "* %s da uma chave para %s.", sendername ,giveplayer); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } } } } return 1; }
Nao sei resolver seu problema, mas para nao cficar criando topico pedindo as coisas vou aproveitar esse pra lhe pedir, eu estava precisando de um concessionaria, vc consegue fazer um FS dessa conce pra mim?
|
Liba.Nakajima o meu gm so permite ao player ter 2 chaves de carros... voce me ajuda a arrumar para poder ter mais?
ficaria muito agradecido... |
enum pInfo
{
pPcarkey,
pPcarkey2,
pPcarkey3, // Essa aqui й adicionada
......
}
й so por Esse Code aqi no seu GM
Код:
if(strcmp(cmd, "/darchaves", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); new car; if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD1, "USE: /darchaves [id]"); return 1; } giveplayerid = ReturnUser(tmp); if(HireCar[playerid] == 299 && PlayerInfo[playerid][pPHousekey] == 255) { SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo tem uma chave para dar"); return 1; } else { if(HireCar[playerid] != 299 && SwitchKey[playerid] == 0) { car = HireCar[playerid]; VTrancado[car] = 0; UnLockCar(car); HireCar[playerid] = 299; } else { car = PlayerInfo[playerid][pPHousekey]+totalveiculos; } } if (IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { if(ProxDetectorS(5.0, playerid, giveplayerid)) { if(HireCar[giveplayerid] != 299) { VTrancado[HireCar[giveplayerid]] = 0; UnLockCar(HireCar[giveplayerid]); } HireCar[giveplayerid] = car; HireCar[playerid] = 999; GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), " Vocк deu a chave do seu veiculo para %s", giveplayer); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); SendClientMessage(playerid, COLOR_GRAD1, string); format(string, sizeof(string), " Vocк recebeu a chave do veiuclo de %s", sendername); SendClientMessage(giveplayerid, COLOR_GRAD1, string); format(string, sizeof(string), "* %s da uma chave para %s.", sendername ,giveplayer); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } } } } return 1; } Eu entendi que й pra dar Chaves pra outro Player , Certo ? |