Advertisement
Guest User

Untitled

a guest
Aug 12th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.03 KB | None | 0 0
  1. // This is a comment
  2. // uncomment the line below if you want to write a filterscript
  3. //#define FILTERSCRIPT
  4.  
  5. #include "../pawno/include/a_samp.inc"
  6. #include "../pawno/include/a_mysql.inc"
  7.  
  8. #define MySQL_HOST "localhost"
  9. #define MySQL_USER "root"
  10. #define MySQL_DATA "gta-online"
  11. #define MySQL_PASS ""
  12.  
  13. stock GetPlayerNameEx( playerid )
  14. {
  15. new
  16. Name[ MAX_PLAYER_NAME ]
  17. ;
  18. GetPlayerName( playerid,Name,MAX_PLAYER_NAME );
  19. return Name;
  20. }
  21.  
  22.  
  23. public OnGameModeInit()
  24. {
  25. mysql_debug( true );
  26. mysql_connect( MySQL_HOST,MySQL_USER,MySQL_DATA,MySQL_PASS );
  27. if( mysql_ping( ) >= 1 )
  28. {
  29. print( "Prisijungeme prie MySQL sekmingai!" );
  30. }
  31. else
  32. {
  33. SendRconCommand( "exit" );
  34. }
  35. return true;
  36. }
  37.  
  38. public OnGameModeExit()
  39. {
  40. mysql_close( );
  41. return true;
  42. }
  43.  
  44. public OnPlayerRequestClass(playerid, classid)
  45. {
  46. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  47. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  48. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  49. return 1;
  50. }
  51.  
  52. public OnPlayerConnect(playerid)
  53. {
  54. new
  55. Query[ 200 ]
  56. ;
  57. format( Query,sizeof( Query ),"SELECT * FROM 'players' WHERE 'Vardas' = '%s'",GetPlayerNameEx( playerid ) );
  58. mysql_query( Query );
  59. mysql_store_result( );
  60.  
  61. if( mysql_num_rows( ) )
  62. {
  63. ShowPlayerDialog( playerid,0,DIALOG_STYLE_INPUT,"Login","Praðme prisijungti","Jungtis","Atðaukti" );
  64. }
  65. else
  66. {
  67. ShowPlayerDialog( playerid,0,DIALOG_STYLE_INPUT,"Register","Praðome uþsiregistruoti","Register","Atðaukti" );
  68. }
  69. mysql_free_result( );
  70. return true;
  71. }
  72.  
  73. public OnPlayerDisconnect(playerid, reason)
  74. {
  75. return 1;
  76. }
  77.  
  78. public OnPlayerSpawn(playerid)
  79. {
  80. return 1;
  81. }
  82.  
  83. public OnPlayerDeath(playerid, killerid, reason)
  84. {
  85. return 1;
  86. }
  87.  
  88. public OnVehicleSpawn(vehicleid)
  89. {
  90. return 1;
  91. }
  92.  
  93. public OnVehicleDeath(vehicleid, killerid)
  94. {
  95. return 1;
  96. }
  97.  
  98. public OnPlayerText(playerid, text[])
  99. {
  100. return 1;
  101. }
  102.  
  103. public OnPlayerCommandText(playerid, cmdtext[])
  104. {
  105. if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  106. {
  107. // Do something here
  108. return 1;
  109. }
  110. return 0;
  111. }
  112.  
  113. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  114. {
  115. return 1;
  116. }
  117.  
  118. public OnPlayerExitVehicle(playerid, vehicleid)
  119. {
  120. return 1;
  121. }
  122.  
  123. public OnPlayerStateChange(playerid, newstate, oldstate)
  124. {
  125. return 1;
  126. }
  127.  
  128. public OnPlayerEnterCheckpoint(playerid)
  129. {
  130. return 1;
  131. }
  132.  
  133. public OnPlayerLeaveCheckpoint(playerid)
  134. {
  135. return 1;
  136. }
  137.  
  138. public OnPlayerEnterRaceCheckpoint(playerid)
  139. {
  140. return 1;
  141. }
  142.  
  143. public OnPlayerLeaveRaceCheckpoint(playerid)
  144. {
  145. return 1;
  146. }
  147.  
  148. public OnRconCommand(cmd[])
  149. {
  150. return 1;
  151. }
  152.  
  153. public OnPlayerRequestSpawn(playerid)
  154. {
  155. return 1;
  156. }
  157.  
  158. public OnObjectMoved(objectid)
  159. {
  160. return 1;
  161. }
  162.  
  163. public OnPlayerObjectMoved(playerid, objectid)
  164. {
  165. return 1;
  166. }
  167.  
  168. public OnPlayerPickUpPickup(playerid, pickupid)
  169. {
  170. return 1;
  171. }
  172.  
  173. public OnVehicleMod(playerid, vehicleid, componentid)
  174. {
  175. return 1;
  176. }
  177.  
  178. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  179. {
  180. return 1;
  181. }
  182.  
  183. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  184. {
  185. return 1;
  186. }
  187.  
  188. public OnPlayerSelectedMenuRow(playerid, row)
  189. {
  190. return 1;
  191. }
  192.  
  193. public OnPlayerExitedMenu(playerid)
  194. {
  195. return 1;
  196. }
  197.  
  198. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  199. {
  200. return 1;
  201. }
  202.  
  203. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  204. {
  205. return 1;
  206. }
  207.  
  208. public OnRconLoginAttempt(ip[], password[], success)
  209. {
  210. return 1;
  211. }
  212.  
  213. public OnPlayerUpdate(playerid)
  214. {
  215. return 1;
  216. }
  217.  
  218. public OnPlayerStreamIn(playerid, forplayerid)
  219. {
  220. return 1;
  221. }
  222.  
  223. public OnPlayerStreamOut(playerid, forplayerid)
  224. {
  225. return 1;
  226. }
  227.  
  228. public OnVehicleStreamIn(vehicleid, forplayerid)
  229. {
  230. return 1;
  231. }
  232.  
  233. public OnVehicleStreamOut(vehicleid, forplayerid)
  234. {
  235. return 1;
  236. }
  237.  
  238. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  239. {
  240. if( dialogid = 0 ) //reg
  241. {
  242. if( response )
  243. {
  244. if( !strlen( inputtext ) )
  245. return SendClientMessage( playerid,-1,"Laukelis negali bûti tuðèias." );
  246. if( strlen( inputtext ) > 40 )
  247. return SendClietMessage( playerid,-1,"Slaptaþodis negali bûti ilgesnis nei 40 simbloiø." );
  248.  
  249. new
  250. Query[ 150 ]
  251. ;
  252. format( Query,sizeof( Query ),"INSERT INTO 'players' (Vardas,Slaptazodis) VALUES ('%s','%xs')",GetPlayerNameEx( playerid ),inputtext );
  253. mysql_query( Query);
  254. }
  255. else
  256. {
  257. Kick( playerid );
  258. }
  259. return true;
  260. }
  261. if( dialogid = 1 //log
  262. {
  263. if( response )
  264. {
  265. if( !strlen( inputtext ) )
  266. return SendClietMessage( playerid,-1,"Laukelis negali bûti tuðèias." );
  267. if( strlen( inputtext ) > ë0 )
  268. return SendClietMessage( playerid,-1,"Slaptaþodis negali bûti ilgesnis nei 40 simboliø." );
  269.  
  270. new
  271. Query[ 150 ]
  272. ;
  273. format( Query,sizeof( Query ),"SELECT * FROM 'players' WHERE 'Vardas' = '%s' AND 'Slaptazodis' = '%s'",GetPlayerNameEx( playerid ),inputtext );
  274. mysql_query( Query );
  275. mysql_store_result( );
  276.  
  277. if(! mysql_num_rows( ) )
  278. {
  279. Kick( playerid );
  280. }
  281. else
  282. {
  283. SendClientMessage( playerid,-1,"Prisijungëte sëkmingaiÀ" );
  284. }
  285. if( !response )
  286. {
  287. Kick( playerid );
  288. }
  289. mysql_free_result( );
  290. return true;
  291. }
  292. return true;
  293. }
  294. return true;
  295.  
  296. }
  297.  
  298. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  299. {
  300. return 1;
  301. }
  302.  
  303.  
  304.  
  305. errorrrrrrraaaaaiiii
  306. F:\Scriptingas\Mokomes\gamemodes\role-play.pwn(70) : warning 217: loose indentation
  307. F:\Scriptingas\Mokomes\gamemodes\role-play.pwn(240) : warning 211: possibly unintended assignment
  308. F:\Scriptingas\Mokomes\gamemodes\role-play.pwn(246) : warning 217: loose indentation
  309. F:\Scriptingas\Mokomes\gamemodes\role-play.pwn(247) : error 017: undefined symbol "SendClietMessage"
  310. F:\Scriptingas\Mokomes\gamemodes\role-play.pwn(259) : warning 217: loose indentation
  311. F:\Scriptingas\Mokomes\gamemodes\role-play.pwn(261) : warning 217: loose indentation
  312. F:\Scriptingas\Mokomes\gamemodes\role-play.pwn(261) : warning 211: possibly unintended assignment
  313. F:\Scriptingas\Mokomes\gamemodes\role-play.pwn(262) : error 029: invalid expression, assumed zero
  314. F:\Scriptingas\Mokomes\gamemodes\role-play.pwn(266) : error 017: undefined symbol "SendClietMessage"
  315. F:\Scriptingas\Mokomes\gamemodes\role-play.pwn(267) : warning 217: loose indentation
  316. F:\Scriptingas\Mokomes\gamemodes\role-play.pwn(267) : error 029: invalid expression, assumed zero
  317. F:\Scriptingas\Mokomes\gamemodes\role-play.pwn(267) : warning 215: expression has no effect
  318. F:\Scriptingas\Mokomes\gamemodes\role-play.pwn(267) : error 001: expected token: ";", but found ")"
  319. F:\Scriptingas\Mokomes\gamemodes\role-play.pwn(267) : error 029: invalid expression, assumed zero
  320. F:\Scriptingas\Mokomes\gamemodes\role-play.pwn(267) : fatal error 107: too many error messages on one line
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement