Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2015
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.29 KB | None | 0 0
  1. enum pInfo
  2. {
  3. pLevel,
  4. pPcarkey,
  5. pPcarkey2,
  6. pPcarkey3,
  7. }
  8.  
  9. public OnPlayerConnect(playerid)
  10. {
  11. GotCar[playerid] = false;
  12. PlayerInfo[playerid][pLevel] = 0;
  13. PlayerInfo[playerid][pPcarkey] = -1;
  14. PlayerInfo[playerid][pPcarkey2] = -1;
  15. PlayerInfo[playerid][pPcarkey3] = -1;
  16. for(new h = carsonserver; h < sizeof(CarInfo); h++)
  17. {
  18. SetVehicleParamsForPlayer(h,playerid,0,CarInfo[h][cLock]);
  19. }
  20. return 1;
  21. }
  22.  
  23. public OnPlayerCommandText(playerid, cmdtext[])
  24. {
  25. if(strcmp(cmd, "/acreatecar", true) == 0)
  26. {
  27. if(IsPlayerConnected(playerid))
  28. {
  29. if(GotCar[playerid]) return SendClientMessage(playerid, -1, "You already took the money.");
  30. if(PlayerInfo[playerid][pLevel] < 3)
  31. {
  32. tmp = strtok(cmdtext, idx);
  33. if(!strlen(tmp))
  34. {
  35. SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /acreatecar [carid] [culoare1] [culoare2] [Pretul]");
  36. return 1;
  37. }
  38. new car;
  39. car = strval(tmp);
  40. if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_WHITE, " Vehicle Number can't be below 400 or above 611 !"); return 1; }
  41. tmp = strtok(cmdtext, idx);
  42. if(!strlen(tmp))
  43. {
  44. SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /acreatecar [carid] [culoare1] [culoare2] [Pretul]");
  45. return 1;
  46. }
  47. new color1;
  48. color1 = strval(tmp);
  49. if(color1 < 0 || color1 > 126) { SendClientMessage(playerid, COLOR_WHITE, " Color Number can't be below 0 or above 126 !"); return 1; }
  50. tmp = strtok(cmdtext, idx);
  51. if(!strlen(tmp))
  52. {
  53. SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /acreatecar [carid] [culoare1] [culoare2] [Pretul]");
  54. return 1;
  55. }
  56. new color2;
  57. color2 = strval(tmp);
  58. if(color2 < 0 || color2 > 126) { SendClientMessage(playerid, COLOR_WHITE, " Color Number can't be below 0 or above 126 !"); return 1; }
  59. tmp = strtok(cmdtext, idx);
  60. if(!strlen(tmp))
  61. {
  62. SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /acreatecar [carid] [culoare1] [culoare2] [Pretul]");
  63. return 1;
  64. }
  65. new value;
  66. value = strval(tmp);
  67. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  68. new thiscar = CreateVehicle(car,X,Y,Z,1,color1,color2,99999999);
  69. format(CarInfo[thiscar][cLicense], 32 ,"ForSale");
  70. SetVehicleNumberPlate(vehid,CarInfo[thiscar][cLicense]);
  71. CarInfo[thiscar][cOwned] = 0; CarInfo[thiscar][cModel] = car; CarInfo[thiscar][cColorOne] = color1; CarInfo[thiscar][cColorTwo] = color2;
  72. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  73. CarInfo[thiscar][cValue] = value; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1; LoadComponents(thiscar);
  74. PutPlayerInVehicle(playerid,thiscar,0);
  75. strmid(CarInfo[vehid][cOwner], "Dealership", 0, strlen("Dealership"), 999);
  76. format(CarInfo[thiscar][cDescription], 32, "%s",vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
  77. format(string, sizeof(string), " Masina %d a fost creata cu succes!.", thiscar);
  78. SendClientMessage(playerid, COLOR_BLUE, string);
  79. }
  80. else
  81. {
  82. SendClientMessage(playerid, COLOR_GREY, " You're not authorized to use that command !");
  83. return 1;
  84. }
  85. }
  86. return 1;
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement