Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(strcmp(x_job,"car",true) == 0)
- {
- if(CarOffer[playerid] < 999)
- {
- if(IsPlayerConnected(CarOffer[playerid]))
- {
- if(GetPlayerCash(playerid) > CarPrice[playerid])
- {
- if(IsPlayerInVehicle(CarOffer[playerid], CarID[playerid]))
- {
- if(PlayerInfo[playerid][pJob] == 10)
- {
- GetPlayerName(CarOffer[playerid], giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new points;
- PlayerInfo[CarOffer[playerid]][pCarSkill] ++;
- if(PlayerInfo[CarOffer[playerid]][pCarSkill] == 50)
- { SendClientMessage(CarOffer[playerid], COLOR_YELLOW, "* Abilitatile tale de comerciant auto sunt acum de nivelul 2, jucatorii care cumpara masini de la tine le pot solicita mai repede."); }
- else if(PlayerInfo[CarOffer[playerid]][pCarSkill] == 100)
- { SendClientMessage(CarOffer[playerid], COLOR_YELLOW, "* Abilitatile tale de comerciant auto sunt acum de nivelul 3, jucatorii care cumpara masini de la tine le pot solicita mai repede."); }
- else if(PlayerInfo[CarOffer[playerid]][pCarSkill] == 200)
- { SendClientMessage(CarOffer[playerid], COLOR_YELLOW, "* Abilitatile tale de comerciant auto sunt acum de nivelul 4, jucatorii care cumpara masini de la tine le pot solicita mai repede."); }
- else if(PlayerInfo[CarOffer[playerid]][pCarSkill] == 400)
- { SendClientMessage(CarOffer[playerid], COLOR_YELLOW, "* Abilitatile tale de comerciant auto sunt acum de nivelul 5, jucatorii care cumpara masini de la tine le pot solicita mai repede."); }
- new level = PlayerInfo[CarOffer[playerid]][pCarSkill];
- if(level >= 0 && level <= 50) { points = 1; }
- else if(level >= 51 && level <= 100) { points = 2; }
- else if(level >= 101 && level <= 200) { points = 3; }
- else if(level >= 201 && level <= 400) { points = 4; }
- else if(level >= 401) { points = 7; }
- format(string, sizeof(string), "* Ai cumparat o masina la pretul de %s$, de la comerciantul %s.",GroupDigit(CarPrice[playerid]),giveplayer,points);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "* Ai vandut masina lui %s pentru %s$.",sendername,GroupDigit(CarPrice[playerid]),points);
- SendClientMessage(CarOffer[playerid], COLOR_LIGHTBLUE, string);
- GivePlayerCash(CarOffer[playerid], CarPrice[playerid]);
- GivePlayerCash(playerid, -CarPrice[playerid]);
- RemovePlayerFromVehicle(CarOffer[playerid]);
- PlayerInfo[playerid][pCarKey] = CarID[playerid];
- PlayerInfo[CarOffer[playerid]][pCarKey] = 999;
- strmid(VehicleInfo[CarID[playerid]][vOwner], sendername, 0, strlen(sendername), 255);
- CarOffer[playerid] = 999;
- CarPrice[playerid] = 0;
- return 1;
- }
- else if(PlayerInfo[playerid][pCarKey] == 0)
- {
- GetPlayerName(CarOffer[playerid], giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "* Ai cumparat o masina la pretul de %s$, de la %s.",GroupDigit(CarPrice[playerid]),giveplayer);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "* Ai vandut masina lui %s pentru %s$.",sendername,GroupDigit(CarPrice[playerid]));
- SendClientMessage(CarOffer[playerid], COLOR_LIGHTBLUE, string);
- GivePlayerCash(CarOffer[playerid], CarPrice[playerid]);
- GivePlayerCash(playerid, -CarPrice[playerid]);
- RemovePlayerFromVehicle(CarOffer[playerid]);
- PlayerInfo[playerid][pCarKey] = CarID[playerid];
- PlayerInfo[CarOffer[playerid]][pCarKey] = 999;
- CarOffer[playerid] = 999;
- CarPrice[playerid] = 0;
- strmid(VehicleInfo[CarID[playerid]][vOwner], sendername, 0, strlen(sendername), 255);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "Comerciantul nu se afla in masina oferita!");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "Nu iti permiti masina!");
- return 1;
- }
- }
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "Nimeni nu s-a oferit sa cumpere masina!");
- return 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment