Guest User

2

a guest
Apr 27th, 2013
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 5.49 KB | None | 0 0
  1.     if(strcmp(x_job,"car",true) == 0)
  2.          {
  3.              if(CarOffer[playerid] < 999)
  4.              {
  5.                  if(IsPlayerConnected(CarOffer[playerid]))
  6.                  {
  7.                      if(GetPlayerCash(playerid) > CarPrice[playerid])
  8.                      {
  9.                          if(IsPlayerInVehicle(CarOffer[playerid], CarID[playerid]))
  10.                          {
  11.                              if(PlayerInfo[playerid][pJob] == 10)
  12.                              {
  13.                                 GetPlayerName(CarOffer[playerid], giveplayer, sizeof(giveplayer));
  14.                                 GetPlayerName(playerid, sendername, sizeof(sendername));
  15.                                 new points;
  16.                                 PlayerInfo[CarOffer[playerid]][pCarSkill] ++;
  17.                                 if(PlayerInfo[CarOffer[playerid]][pCarSkill] == 50)
  18.                                 { 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."); }
  19.                                 else if(PlayerInfo[CarOffer[playerid]][pCarSkill] == 100)
  20.                                 { 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."); }
  21.                                 else if(PlayerInfo[CarOffer[playerid]][pCarSkill] == 200)
  22.                                 { 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."); }
  23.                                 else if(PlayerInfo[CarOffer[playerid]][pCarSkill] == 400)
  24.                                 { 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."); }
  25.                                 new level = PlayerInfo[CarOffer[playerid]][pCarSkill];
  26.                                 if(level >= 0 && level <= 50) { points = 1; }
  27.                                 else if(level >= 51 && level <= 100) { points = 2; }
  28.                                 else if(level >= 101 && level <= 200) { points = 3; }
  29.                                 else if(level >= 201 && level <= 400) { points = 4; }
  30.                                 else if(level >= 401) { points = 7; }
  31.                                 format(string, sizeof(string), "* Ai cumparat o masina la pretul de %s$, de la comerciantul %s.",GroupDigit(CarPrice[playerid]),giveplayer,points);
  32.                                 SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  33.                                 format(string, sizeof(string), "* Ai vandut masina lui %s pentru %s$.",sendername,GroupDigit(CarPrice[playerid]),points);
  34.                                 SendClientMessage(CarOffer[playerid], COLOR_LIGHTBLUE, string);
  35.                                 GivePlayerCash(CarOffer[playerid], CarPrice[playerid]);
  36.                                 GivePlayerCash(playerid, -CarPrice[playerid]);
  37.                                 RemovePlayerFromVehicle(CarOffer[playerid]);
  38.                                 PlayerInfo[playerid][pCarKey] = CarID[playerid];
  39.                                 PlayerInfo[CarOffer[playerid]][pCarKey] = 999;
  40.                                 strmid(VehicleInfo[CarID[playerid]][vOwner], sendername, 0, strlen(sendername), 255);
  41.                                 CarOffer[playerid] = 999;
  42.                                 CarPrice[playerid] = 0;
  43.                                 return 1;
  44.                         }
  45.                         else if(PlayerInfo[playerid][pCarKey] == 0)
  46.                         {
  47.                             GetPlayerName(CarOffer[playerid], giveplayer, sizeof(giveplayer));
  48.                             GetPlayerName(playerid, sendername, sizeof(sendername));
  49.                             format(string, sizeof(string), "* Ai cumparat o masina la pretul de %s$, de la %s.",GroupDigit(CarPrice[playerid]),giveplayer);
  50.                             SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  51.                             format(string, sizeof(string), "* Ai vandut masina lui %s pentru %s$.",sendername,GroupDigit(CarPrice[playerid]));
  52.                             SendClientMessage(CarOffer[playerid], COLOR_LIGHTBLUE, string);
  53.                             GivePlayerCash(CarOffer[playerid], CarPrice[playerid]);
  54.                             GivePlayerCash(playerid, -CarPrice[playerid]);
  55.                             RemovePlayerFromVehicle(CarOffer[playerid]);
  56.                             PlayerInfo[playerid][pCarKey] = CarID[playerid];
  57.                             PlayerInfo[CarOffer[playerid]][pCarKey] = 999;
  58.                             CarOffer[playerid] = 999;
  59.                             CarPrice[playerid] = 0;
  60.                             strmid(VehicleInfo[CarID[playerid]][vOwner], sendername, 0, strlen(sendername), 255);
  61.                         }
  62.                      }
  63.                      else
  64.                      {
  65.                          SendClientMessage(playerid, COLOR_GREY, "Comerciantul nu se afla in masina oferita!");
  66.                          return 1;
  67.                     }
  68.                 }
  69.                 else
  70.                 {
  71.                     SendClientMessage(playerid, COLOR_GREY, "Nu iti permiti masina!");
  72.                     return 1;
  73.                 }
  74.             }
  75.             return 1;
  76.          }
  77.          else
  78.          {
  79.             SendClientMessage(playerid, COLOR_GREY, "Nimeni nu s-a oferit sa cumpere masina!");
  80.             return 1;
  81.          }
  82.      }
Advertisement
Add Comment
Please, Sign In to add comment