Advertisement
Guest User

Oxside

a guest
Nov 17th, 2009
2,480
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.97 KB | None | 0 0
  1. #include <a_samp>
  2. #include <dudb>
  3. #include <Dini>
  4. #include <dutils>
  5.  
  6.  
  7. new WeedSeeds[MAX_PLAYERS];
  8. new Coke[MAX_PLAYERS];
  9. new Planted[MAX_PLAYERS];
  10.  
  11. forward PlantedWeed(playerid);
  12.  
  13. #if defined FILTERSCRIPT
  14.  
  15. public OnFilterScriptInit()
  16. {
  17.     print("\n--------------------------------------");
  18.     print(" Blank Filterscript by your name here");
  19.     print("--------------------------------------\n");
  20.     return 1;
  21. }
  22.  
  23. public OnFilterScriptExit()
  24. {
  25.     return 1;
  26. }
  27.  
  28. #else
  29.  
  30. main()
  31. {
  32.     print("\n----------------------------------");
  33.     print(" Blank Gamemode by your name here");
  34.     print("----------------------------------\n");
  35. }
  36.  
  37. #endif
  38.  
  39. public OnGameModeInit()
  40. {
  41.     // Don't use these lines if it's a filterscript
  42.     SetGameModeText("Blank Script");
  43.     AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  44.     return 1;
  45. }
  46.  
  47. public OnGameModeExit()
  48. {
  49.     return 1;
  50. }
  51.  
  52. public OnPlayerRequestClass(playerid, classid)
  53. {
  54.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  55.     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  56.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  57.     return 1;
  58. }
  59.  
  60. public OnPlayerConnect(playerid)
  61. {
  62.     new formatZ[256];
  63.     new pName[MAX_PLAYER_NAME];
  64.     new string[48];
  65.     format(formatZ,sizeof(formatZ),"%s.ox",PlayerName(playerid));
  66.     if(!udb_Exists(formatZ))
  67.     {
  68.     udb_Create(formatZ,"209010");
  69.     }
  70.     WeedSeeds[playerid] = dUserINT(formatZ).("WeedSeeds");
  71.     Coke[playerid] = dUserINT(formatZ).("Coke");
  72.     Planted[playerid] = dUserINT(formatZ).("Planted");
  73.     return 1;
  74. }
  75.  
  76. public OnPlayerDisconnect(playerid, reason)
  77. {
  78.     new formatZ2[256];
  79.     new pName[MAX_PLAYER_NAME];
  80.     new string[56];
  81.     format(formatZ2,sizeof(formatZ2),"%s.ox",PlayerName(playerid));
  82.     dUserSetINT(formatZ2).("WeedSeeds",WeedSeeds[playerid]);
  83.     dUserSetINT(formatZ2).("Coke",Coke[playerid]);
  84.     dUserSetINT(formatZ2).("Planted",Planted[playerid]);
  85.     return 1;
  86. }
  87.  
  88. public OnPlayerSpawn(playerid)
  89. {
  90.     return 1;
  91. }
  92.  
  93. public OnPlayerDeath(playerid, killerid, reason)
  94. {
  95.     return 1;
  96. }
  97.  
  98. public OnVehicleSpawn(vehicleid)
  99. {
  100.     return 1;
  101. }
  102.  
  103. public OnVehicleDeath(vehicleid, killerid)
  104. {
  105.     return 1;
  106. }
  107.  
  108. public OnPlayerText(playerid, text[])
  109. {
  110.     return 1;
  111. }
  112.  
  113. public OnPlayerCommandText(playerid, cmdtext[])
  114. {
  115. // ===============================================================================
  116. //                              DRUGSDEALERs COMMAND
  117. // ===============================================================================
  118.     if (strcmp("/buyweed", cmdtext, true, 10) == 0)
  119.     {
  120.         GivePlayerMoney(playerid, -500);
  121.         WeedSeeds[playerid] = 500;
  122.         SendClientMessage(playerid, COLOR_LIGHTGREEN, "You have buyed some weed seeds (500) ");
  123.         return 1;
  124.     }
  125.     if (strcmp("/plantweed", cmdtext, true, 10) == 0)
  126.     {
  127.         if(WeedSeeds[playerid] >= 1)
  128.         {
  129.         WeedSeeds[playerid] = 0;
  130.         Planted[playerid] = 1;
  131.         SetTimer("PlantedWeed",600000,false);
  132.         SendClientMessage(playerid, COLOR_LIGHTGREEN, "[INFO] You have planted all your weed seeds!");
  133.         }
  134.         else
  135.         {
  136.         SendClientMessage(playerid, COLOR_RED, "[ERROR] You dont have any weed seeds, so you cant plant them!");
  137.         }
  138.         return 1;
  139.     }
  140.  
  141.     if (strcmp("/pickupweed", cmdtext, true, 10) == 0)
  142.     {
  143.         if(Planted[playerid] >= 1)
  144.         {
  145.         SendClientMessage(playerid, COLOR_RED, "[ERROR] It is not the time yet to pickup your seeds, please be patient!");
  146.         }
  147.         // Here must come pickup animation
  148.         Coke[playerid] = 99;
  149.         SendClientMessage(playerid, COLOR_LIGHTGREEN, "[INFO] You have picked up you weed an have now 99 gram coke!");
  150.         return 1;
  151.     }
  152.  
  153.     if (strcmp("/sellcoke", cmdtext, true, 10) == 0)
  154.     {
  155.         if(Coke[playerid] <= 0)
  156.         {
  157.         SendClientMessage(playerid, COLOR_RED, "[ERROR] You dont have any coke to sell!");
  158.         }
  159.         GivePlayerMoney(playerid, 1000);
  160.         Coke[playerid] = 0;
  161.         SendClientMessage(playerid, COLOR_LIGHTGREEN, "[INFO] You have succesfully selled your coke for $1000!");
  162.         return 1;
  163.     }
  164.     return 0;
  165. }
  166.  
  167. public PlantedWeed(playerid)
  168. {
  169.     Planted[playerid] = 0;
  170.     SendClientMessage(playerid, COLOR_LIGHTGREEN, "[INFO] Your planted weed seeds are ready to pick them up! (/pickupweed)");
  171. }
  172.  
  173.     return 0;
  174. }
  175.  
  176. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  177. {
  178.     return 1;
  179. }
  180.  
  181. public OnPlayerExitVehicle(playerid, vehicleid)
  182. {
  183.     return 1;
  184. }
  185.  
  186. public OnPlayerStateChange(playerid, newstate, oldstate)
  187. {
  188.     return 1;
  189. }
  190.  
  191. public OnPlayerEnterCheckpoint(playerid)
  192. {
  193.     return 1;
  194. }
  195.  
  196. public OnPlayerLeaveCheckpoint(playerid)
  197. {
  198.     return 1;
  199. }
  200.  
  201. public OnPlayerEnterRaceCheckpoint(playerid)
  202. {
  203.     return 1;
  204. }
  205.  
  206. public OnPlayerLeaveRaceCheckpoint(playerid)
  207. {
  208.     return 1;
  209. }
  210.  
  211. public OnRconCommand(cmd[])
  212. {
  213.     return 1;
  214. }
  215.  
  216. public OnPlayerRequestSpawn(playerid)
  217. {
  218.     return 1;
  219. }
  220.  
  221. public OnObjectMoved(objectid)
  222. {
  223.     return 1;
  224. }
  225.  
  226. public OnPlayerObjectMoved(playerid, objectid)
  227. {
  228.     return 1;
  229. }
  230.  
  231. public OnPlayerPickUpPickup(playerid, pickupid)
  232. {
  233.     return 1;
  234. }
  235.  
  236. public OnVehicleMod(playerid, vehicleid, componentid)
  237. {
  238.     return 1;
  239. }
  240.  
  241. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  242. {
  243.     return 1;
  244. }
  245.  
  246. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  247. {
  248.     return 1;
  249. }
  250.  
  251. public OnPlayerSelectedMenuRow(playerid, row)
  252. {
  253.     return 1;
  254. }
  255.  
  256. public OnPlayerExitedMenu(playerid)
  257. {
  258.     return 1;
  259. }
  260.  
  261. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  262. {
  263.     return 1;
  264. }
  265.  
  266. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  267. {
  268.     return 1;
  269. }
  270.  
  271. public OnRconLoginAttempt(ip[], password[], success)
  272. {
  273.     return 1;
  274. }
  275.  
  276. public OnPlayerUpdate(playerid)
  277. {
  278.     return 1;
  279. }
  280.  
  281. public OnPlayerStreamIn(playerid, forplayerid)
  282. {
  283.     return 1;
  284. }
  285.  
  286. public OnPlayerStreamOut(playerid, forplayerid)
  287. {
  288.     return 1;
  289. }
  290.  
  291. public OnVehicleStreamIn(vehicleid, forplayerid)
  292. {
  293.     return 1;
  294. }
  295.  
  296. public OnVehicleStreamOut(vehicleid, forplayerid)
  297. {
  298.     return 1;
  299. }
  300.  
  301. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  302. {
  303.     return 1;
  304. }
  305.  
  306. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  307. {
  308.     return 1;
  309. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement