Advertisement
Gireada

Garaj

Feb 26th, 2013
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.83 KB | None | 0 0
  1. #include <a_samp>
  2. #include <dini>
  3. #include <sscanf>
  4. #include <zcmd>
  5.  
  6. enum PlayerData
  7. {
  8.     pGaraje,
  9. }
  10.  
  11. new PlayerInfo[MAX_PLAYERS][PlayerData];
  12.  
  13. enum GarajData
  14. {
  15.     Float:Intrarex,
  16.     Float:Intrarey,
  17.     Float:Intrarez,
  18.     Float:Iesirex,
  19.     Float:Iesirey,
  20.     Float:Iesirez,
  21.     GarajPropieta[MAX_PLAYER_NAME],
  22.     GarajPret,
  23.     GarajVirtual,
  24. }
  25.  
  26. new PlayerInfo[MAX_PLAYERS][PlayerData];
  27.  
  28. public OnFilterScriptInit()
  29. {
  30.     print("\n--------------------------------------");
  31.     print(" Blank Filterscript by your name here");
  32.     print("--------------------------------------\n");
  33.     return 1;
  34. }
  35.  
  36. public OnFilterScriptExit()
  37. {
  38.     return 1;
  39. }
  40.  
  41. main()
  42. {
  43.     print("\n----------------------------------");
  44.     print(" Blank Gamemode by your name here");
  45.     print("----------------------------------\n");
  46. }
  47.  
  48. public OnPlayerRequestClass(playerid, classid)
  49. {
  50.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  51.     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  52.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  53.     return 1;
  54. }
  55.  
  56. public OnPlayerConnect(playerid)
  57. {
  58.     return 1;
  59. }
  60.  
  61. public OnPlayerDisconnect(playerid, reason)
  62. {
  63.     return 1;
  64. }
  65.  
  66. public OnPlayerSpawn(playerid)
  67. {
  68.     return 1;
  69. }
  70.  
  71. public OnPlayerDeath(playerid, killerid, reason)
  72. {
  73.     return 1;
  74. }
  75.  
  76. public OnVehicleSpawn(vehicleid)
  77. {
  78.     return 1;
  79. }
  80.  
  81. public OnVehicleDeath(vehicleid, killerid)
  82. {
  83.     return 1;
  84. }
  85.  
  86. public OnPlayerText(playerid, text[])
  87. {
  88.     return 1;
  89. }
  90.  
  91. CMD:cumparagaraj(playerid, params[])
  92. {
  93.     if(PlayerInfo[playerid][pGaraj] < 3)
  94.     for(i=
  95.  
  96.     return 1;
  97. }
  98.  
  99. CMD:creategaraj(playerid, params[])
  100. {
  101.     new file[256],mopdelid,pret;
  102.     if(unformat(params, "ii", modelid,pret))
  103.     {
  104.         SendClientMessage(playerid, 0xFF0000AA, "Usage: /creategaraj <modelid> <pret>");
  105.         return 1;
  106.     }
  107.     if(modelid < 0 && modelid > 6)
  108.     {
  109.         SendClientMessage(playerid, 0xFF0000AA, "Model-ul pot fi de la 1 la 5");
  110.         return 1;
  111.     }
  112.     new Float:x, Float:y, Float:z;
  113.     GetPlayerPos(playerid, x,y,z)
  114.     if(IsPlayerAdmin(playerid))
  115.     {
  116.         for(new i= 1; i<=maxgaraje; i++)
  117.         {
  118.             format(file, sizeof(file), "Garaje/%d",i);
  119.             if(dini_Exists(file))
  120.             {
  121.                 if(modelid)
  122.                 {
  123.            
  124.                     GarajInfo[playerid][Intrarex] = x; GarajInfo[playerid][Intrarey] = y; GarajInfo[playerid][Intrarez] = z;
  125.                     GarajInfo[playerid][GarajPret] = pret; GarajInfo[playerid][GarajVirtual] = i;
  126.                     GarajInfo[playerid][Iesirex] = x; GarajInfo[playerid][Iesirey] = y; GarajInfo[playerid][Iesirez] = z;
  127.                     strmid(GarajInfo[idx][GarajPropieta], "N/a", 0, strlen("N/a"), 255);
  128.                     SaveThisGaraj(i);
  129.                 }
  130.             }
  131.         }
  132.     }
  133.     return 1;
  134. }
  135.  
  136. public OnPlayerCommandText(playerid, cmdtext[])
  137. {
  138.     if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  139.     {
  140.         // Do something here
  141.         return 1;
  142.     }
  143.     return 0;
  144. }
  145.  
  146. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  147. {
  148.     return 1;
  149. }
  150.  
  151. public OnPlayerExitVehicle(playerid, vehicleid)
  152. {
  153.     return 1;
  154. }
  155.  
  156. public OnPlayerStateChange(playerid, newstate, oldstate)
  157. {
  158.     return 1;
  159. }
  160.  
  161. public OnPlayerEnterCheckpoint(playerid)
  162. {
  163.     return 1;
  164. }
  165.  
  166. public OnPlayerLeaveCheckpoint(playerid)
  167. {
  168.     return 1;
  169. }
  170.  
  171. public OnPlayerEnterRaceCheckpoint(playerid)
  172. {
  173.     return 1;
  174. }
  175.  
  176. public OnPlayerLeaveRaceCheckpoint(playerid)
  177. {
  178.     return 1;
  179. }
  180.  
  181. public OnRconCommand(cmd[])
  182. {
  183.     return 1;
  184. }
  185.  
  186. public OnPlayerRequestSpawn(playerid)
  187. {
  188.     return 1;
  189. }
  190.  
  191. public OnObjectMoved(objectid)
  192. {
  193.     return 1;
  194. }
  195.  
  196. public OnPlayerObjectMoved(playerid, objectid)
  197. {
  198.     return 1;
  199. }
  200.  
  201. public OnPlayerPickUpPickup(playerid, pickupid)
  202. {
  203.     return 1;
  204. }
  205.  
  206. public OnVehicleMod(playerid, vehicleid, componentid)
  207. {
  208.     return 1;
  209. }
  210.  
  211. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  212. {
  213.     return 1;
  214. }
  215.  
  216. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  217. {
  218.     return 1;
  219. }
  220.  
  221. public OnPlayerSelectedMenuRow(playerid, row)
  222. {
  223.     return 1;
  224. }
  225.  
  226. public OnPlayerExitedMenu(playerid)
  227. {
  228.     return 1;
  229. }
  230.  
  231. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  232. {
  233.     return 1;
  234. }
  235.  
  236. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  237. {
  238.     return 1;
  239. }
  240.  
  241. public OnRconLoginAttempt(ip[], password[], success)
  242. {
  243.     return 1;
  244. }
  245.  
  246. public OnPlayerUpdate(playerid)
  247. {
  248.     return 1;
  249. }
  250.  
  251. public OnPlayerStreamIn(playerid, forplayerid)
  252. {
  253.     return 1;
  254. }
  255.  
  256. public OnPlayerStreamOut(playerid, forplayerid)
  257. {
  258.     return 1;
  259. }
  260.  
  261. public OnVehicleStreamIn(vehicleid, forplayerid)
  262. {
  263.     return 1;
  264. }
  265.  
  266. public OnVehicleStreamOut(vehicleid, forplayerid)
  267. {
  268.     return 1;
  269. }
  270.  
  271. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  272. {
  273.     return 1;
  274. }
  275.  
  276. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  277. {
  278.     return 1;
  279. }
  280.  
  281. public LoadGaraje()
  282. {
  283.     new file[512];
  284.     for(new idx=1;idx<maxgarak;idx++)
  285.     {
  286.         format(file, sizeof(file),"Garaje/%d.ini", idx);
  287.         if(dini_Exists(file))
  288.         {
  289.             GarajInfo[idx][Intrarex] = dini_Float(file,"Intrarex");
  290.             GarajInfo[idx][Intrarey] = dini_Float(file,"Intrarey");
  291.             GarajInfo[idx][Intrarez] = dini_Float(file,"Intrarez");
  292.             GarajInfo[idx][Iesirex] = dini_Float(file,"Iesirex");
  293.             GarajInfo[idx][Iesirey] = dini_Float(file,"Iesirey");
  294.             GarajInfo[idx][Iesirez] = dini_Float(file,"Iesirez");
  295.             strmid(GarajInfo[idx][GarajPropieta], dini_Get(file,"Propietar"), 0, strlen(dini_Get(file,"Propietar")), 255);
  296.             GarajInfo[idx][GarajPret] = dini_Int(file,"Pret");
  297.             GarajInfo[idx][GarajVirtual] = dini_Int(file,"Virtual");
  298.         }
  299.     }
  300.     return 1;
  301. }
  302.  
  303. public SaveThisGaraj(garajdid)
  304. {
  305.     new file2[512];
  306.     format(file2, sizeof(file2),"Garaje/%d.ini", garajdid);
  307.     if(dini_Exists(file2))
  308.     {
  309.         dini_FloatSet(file2,"Intrarex",GaraInfo[garajid][Intrarex]);
  310.         dini_FloatSet(file2,"Intrarey",GaraInfo[garajid][Intrarey]);
  311.         dini_FloatSet(file2,"Intrarez",GaraInfo[garajid][Intrarez]);
  312.         dini_FloatSet(file2,"Iesirex",GaraInfo[garajid][Iesirex]);
  313.         dini_FloatSet(file2,"Iesirey",GaraInfo[garajid][Iesirey]);
  314.         dini_FloatSet(file2,"Iesirez",GaraInfo[garajid][Iesirez]);
  315.         dini_Set(file2,"Propietar",GaraInfo[garajid][GarajPropieta]);
  316.         dini_IntSet(file2,"Pret",GaraInfo[garajid][GarajPret]);
  317.         dini_IntSet(file2,"Virtual",GaraInfo[garajid][GarajVirtual]);
  318.         return 1;
  319.     }
  320.     else if(!dini_Exists(file2))
  321.     {
  322.         dini_Create(file2);
  323.         dini_FloatSet(file2,"Intrarex",GaraInfo[garajid][Intrarex]);
  324.         dini_FloatSet(file2,"Intrarey",GaraInfo[garajid][Intrarey]);
  325.         dini_FloatSet(file2,"Intrarez",GaraInfo[garajid][Intrarez]);
  326.         dini_FloatSet(file2,"Iesirex",GaraInfo[garajid][Iesirex]);
  327.         dini_FloatSet(file2,"Iesirey",GaraInfo[garajid][Iesirey]);
  328.         dini_FloatSet(file2,"Iesirez",GaraInfo[garajid][Iesirez]);
  329.         dini_Set(file2,"Propietar",GaraInfo[garajid][GarajPropieta]);
  330.         dini_IntSet(file2,"Pret",GaraInfo[garajid][GarajPret]);
  331.         dini_IntSet(file2,"Virtual",GaraInfo[garajid][GarajVirtual]);
  332.         return 1;
  333.     }
  334.     return 1;
  335. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement