RenaldasJ

Dinaminės bankomatų sistemos pagrindas.

Dec 6th, 2013
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.48 KB | None | 0 0
  1. /*
  2.  
  3.     Autorius - Renas.
  4.     Sistema: Dinaminė bankomatų sistema.
  5.     Išleista: 2012-05-26 dieną
  6.                    
  7.  
  8.                                                     */
  9. #define FILTERSCRIPT
  10.  
  11. #include <a_samp>
  12. #include <zcmd>
  13. #include <sscanf2>
  14.  
  15. /* defines sistemai */
  16. #define MAX_BANKOMATU   1
  17.  
  18. enum _bankomatuData
  19. {
  20.     Float:posX,
  21.     Float:posY,
  22.     Float:posZ,
  23.     Text3D:bankomato3D,
  24.     BankomatoObjektas
  25. };
  26. new bankoData [ MAX_BANKOMATU ] [ _bankomatuData ] ;
  27.  
  28. #if defined FILTERSCRIPT
  29.  
  30. public OnFilterScriptInit()
  31. {
  32.     print("\n--------------------------------------");
  33.     print(" Dinaminė bankomatų sistema by Renas");
  34.     print("--------------------------------------\n");
  35.     return 1;
  36. }
  37.  
  38. public OnFilterScriptExit()
  39. {
  40.     return 1;
  41. }
  42.  
  43.  
  44.  
  45.  
  46.  
  47. public OnPlayerRequestClass(playerid, classid)
  48. {
  49.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  50.     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  51.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  52.     return 1;
  53. }
  54.  
  55. public OnPlayerConnect(playerid)
  56. {
  57.     return 1;
  58. }
  59.  
  60. public OnPlayerDisconnect(playerid, reason)
  61. {
  62.     return 1;
  63. }
  64.  
  65. public OnPlayerSpawn(playerid)
  66. {
  67.     return 1;
  68. }
  69.  
  70. public OnPlayerDeath(playerid, killerid, reason)
  71. {
  72.     return 1;
  73. }
  74.  
  75. public OnVehicleSpawn(vehicleid)
  76. {
  77.     return 1;
  78. }
  79.  
  80. public OnVehicleDeath(vehicleid, killerid)
  81. {
  82.     return 1;
  83. }
  84.  
  85. public OnPlayerText(playerid, text[])
  86. {
  87.     return 1;
  88. }
  89.  
  90. public OnPlayerCommandText(playerid, cmdtext[])
  91. {
  92.  
  93.     return 0;
  94. }
  95.  
  96. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  97. {
  98.     return 1;
  99. }
  100.  
  101. public OnPlayerExitVehicle(playerid, vehicleid)
  102. {
  103.     return 1;
  104. }
  105.  
  106. public OnPlayerStateChange(playerid, newstate, oldstate)
  107. {
  108.     return 1;
  109. }
  110.  
  111. public OnPlayerEnterCheckpoint(playerid)
  112. {
  113.     return 1;
  114. }
  115.  
  116. public OnPlayerLeaveCheckpoint(playerid)
  117. {
  118.     return 1;
  119. }
  120.  
  121. public OnPlayerEnterRaceCheckpoint(playerid)
  122. {
  123.     return 1;
  124. }
  125.  
  126. public OnPlayerLeaveRaceCheckpoint(playerid)
  127. {
  128.     return 1;
  129. }
  130.  
  131. public OnRconCommand(cmd[])
  132. {
  133.     return 1;
  134. }
  135.  
  136. public OnPlayerRequestSpawn(playerid)
  137. {
  138.     return 1;
  139. }
  140.  
  141. public OnObjectMoved(objectid)
  142. {
  143.     return 1;
  144. }
  145.  
  146. public OnPlayerObjectMoved(playerid, objectid)
  147. {
  148.     return 1;
  149. }
  150.  
  151. public OnPlayerPickUpPickup(playerid, pickupid)
  152. {
  153.     return 1;
  154. }
  155.  
  156. public OnVehicleMod(playerid, vehicleid, componentid)
  157. {
  158.     return 1;
  159. }
  160.  
  161. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  162. {
  163.     return 1;
  164. }
  165.  
  166. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  167. {
  168.     return 1;
  169. }
  170.  
  171. public OnPlayerSelectedMenuRow(playerid, row)
  172. {
  173.     return 1;
  174. }
  175.  
  176. public OnPlayerExitedMenu(playerid)
  177. {
  178.     return 1;
  179. }
  180.  
  181. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  182. {
  183.     return 1;
  184. }
  185.  
  186. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  187. {
  188.     for(  new i = 0; i < MAX_BANKOMATU; i ++ )
  189.     {
  190.         if( IsPlayerInRangeOfPoint ( playerid, 3.0, bankoData [ i ] [ posX ] , bankoData [ i ] [ posY ] , bankoData [ i ] [ posZ ] ))
  191.         {
  192.             if( newkeys & KEY_FIRE )
  193.             {
  194.                 SendClientMessage(  playerid , -1 , "ALT mygtukas !");
  195.                 printf("Skriptas suveikė, žaidėjas nuspaudė ALT mygtuką.");
  196.             }
  197.         }
  198.         return 1;
  199.     }
  200.     return 1;
  201. }
  202.  
  203. public OnRconLoginAttempt(ip[], password[], success)
  204. {
  205.     return 1;
  206. }
  207.  
  208. public OnPlayerUpdate(playerid)
  209. {
  210.     return 1;
  211. }
  212.  
  213. public OnPlayerStreamIn(playerid, forplayerid)
  214. {
  215.     return 1;
  216. }
  217.  
  218. public OnPlayerStreamOut(playerid, forplayerid)
  219. {
  220.     return 1;
  221. }
  222.  
  223. public OnVehicleStreamIn(vehicleid, forplayerid)
  224. {
  225.     return 1;
  226. }
  227.  
  228. public OnVehicleStreamOut(vehicleid, forplayerid)
  229. {
  230.     return 1;
  231. }
  232.  
  233. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  234. {
  235.     return 1;
  236. }
  237.  
  238. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  239. {
  240.     return 1;
  241. }
  242.  
  243. // Komandos
  244.  
  245. CMD:bankomatas ( playerid )
  246. {
  247.     new Float:x,Float:y,Float:z,string[ 100 ];
  248.     GetPlayerPos(playerid,x,y,z);
  249.     for ( new i = 0; i < MAX_BANKOMATU ; i ++ )
  250.     {
  251.         bankoData [ i ] [ posX ] = x;
  252.         bankoData [ i ] [ posY ] = y;
  253.         bankoData [ i ] [ posZ ] = z;
  254.  
  255.         format(string,sizeof(string),"{ffff00}Bankomatas\nSpausk ALT norint valdyti savo banko sąskaitą.");
  256.         bankoData [ i ] [ bankomato3D ] = Create3DTextLabel( string , 0xFFFFFF, bankoData [ i ] [ posX ] , bankoData [ i ] [ posY ] , bankoData [ i ] [ posZ ] , 10.0,0,0);
  257.         bankoData [ i ] [ BankomatoObjektas ] = CreateObject(2942, bankoData [ i ] [ posX ], bankoData [ i ] [ posY ],   bankoData [ i ] [ posZ ], 0.00, 0.00, 0.00, 0.00);
  258.         printf("Sukurtas bankomatas pozicijoje - X: %f Y: %f Z: %f\nCiklas, i skaičius = %i",x,y,z,i);
  259.  
  260.  
  261.     }
  262.     return true;
  263. }
  264. #endif
Add Comment
Please, Sign In to add comment