Guest User

score.pwn

a guest
Aug 28th, 2013
626
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.60 KB | None | 0 0
  1. #define FILTERSCRIPT
  2.  
  3. #include <a_samp>
  4.  
  5. new Text:ScoreTextdraw[MAX_PLAYERS];
  6.  
  7. //--------------------- Score forward ---------------------//
  8. forward scoretimer(playerid);
  9. public scoretimer()
  10. {
  11. for(new i=0; i<MAX_PLAYERS; i++)
  12. {
  13. if(IsPlayerConnected(i))
  14. {
  15. new score[128];
  16. format(score, sizeof(score), "Score:%d",GetPlayerScore(i));
  17. TextDrawSetString(ScoreTextdraw[i], score);
  18. }
  19. }
  20. return 1;
  21. }
  22.  
  23. public OnFilterScriptInit()
  24.  
  25. {
  26. print("\n-------------------------------------------------");
  27. print(" score textdraw by kjek98 and from JimmyCh tutorial");
  28. print("-------------------------------------------------\n");
  29.  
  30.  
  31. SetTimer("scoretimer", 1000, true);
  32. return 1;
  33. }
  34.  
  35.  
  36. public OnFilterScriptExit()
  37. {
  38. return 1;
  39. }
  40.  
  41. public OnPlayerRequestClass(playerid, classid)
  42. {
  43. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  44. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  45. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  46. return 1;
  47. }
  48.  
  49. public OnPlayerConnect(playerid)
  50. {
  51. new score[128];
  52. format(score, sizeof(score), "Score:%d",GetPlayerScore(playerid)); //So our textdraw will show Score: Yourscorehere, the %d is used for GetPlayerScore, which will get the player's score and show it here.
  53. ScoreTextdraw[playerid] = TextDrawCreate(498.000000, 118.000000, score); // we created the textdraw under the health and money thing, you can change the position though.
  54. TextDrawColor(ScoreTextdraw[playerid], 0xB8860BAA); // The color, you can put anything. I made it green here
  55. TextDrawAlignment(ScoreTextdraw[playerid],0); //This is the text alignment
  56. TextDrawFont(ScoreTextdraw[playerid], 1); // We chose a normal font, you can change it, check the samp wiki..
  57. TextDrawShowForPlayer(playerid, ScoreTextdraw[playerid]); // we are showing him the textdraw that we created
  58. TextDrawSetOutline(ScoreTextdraw[playerid],0); // We set the text's outline to 1
  59. TextDrawSetProportional(ScoreTextdraw[playerid],0); // Appears to scale text spacing to a proportional ratio
  60. TextDrawSetShadow(ScoreTextdraw[playerid],0); // Shadow size 1
  61. return 1;
  62. }
  63.  
  64.  
  65.  
  66. public OnPlayerDisconnect(playerid, reason)
  67. {
  68. TextDrawDestroy(ScoreTextdraw[playerid]);
  69. return 1;
  70. }
  71.  
  72. public OnPlayerSpawn(playerid)
  73. {
  74. return 1;
  75. }
  76.  
  77. public OnPlayerDeath(playerid, killerid, reason)
  78. {
  79. return 1;
  80. }
  81.  
  82. public OnVehicleSpawn(vehicleid)
  83. {
  84. return 1;
  85. }
  86.  
  87. public OnVehicleDeath(vehicleid, killerid)
  88. {
  89. return 1;
  90. }
  91.  
  92. public OnPlayerText(playerid, text[])
  93. {
  94. return 1;
  95. }
  96.  
  97. public OnPlayerCommandText(playerid, cmdtext[])
  98. {
  99. if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  100. {
  101. // Do something here
  102. return 1;
  103. }
  104. return 0;
  105. }
  106.  
  107. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  108. {
  109. return 1;
  110. }
  111.  
  112. public OnPlayerExitVehicle(playerid, vehicleid)
  113. {
  114. return 1;
  115. }
  116.  
  117. public OnPlayerStateChange(playerid, newstate, oldstate)
  118. {
  119. return 1;
  120. }
  121.  
  122. public OnPlayerEnterCheckpoint(playerid)
  123. {
  124. return 1;
  125. }
  126.  
  127. public OnPlayerLeaveCheckpoint(playerid)
  128. {
  129. return 1;
  130. }
  131.  
  132. public OnPlayerEnterRaceCheckpoint(playerid)
  133. {
  134. return 1;
  135. }
  136.  
  137. public OnPlayerLeaveRaceCheckpoint(playerid)
  138. {
  139. return 1;
  140. }
  141.  
  142. public OnRconCommand(cmd[])
  143. {
  144. return 1;
  145. }
  146.  
  147. public OnPlayerRequestSpawn(playerid)
  148. {
  149. return 1;
  150. }
  151.  
  152. public OnObjectMoved(objectid)
  153. {
  154. return 1;
  155. }
  156.  
  157. public OnPlayerObjectMoved(playerid, objectid)
  158. {
  159. return 1;
  160. }
  161.  
  162. public OnPlayerPickUpPickup(playerid, pickupid)
  163. {
  164. return 1;
  165. }
  166.  
  167. public OnVehicleMod(playerid, vehicleid, componentid)
  168. {
  169. return 1;
  170. }
  171.  
  172. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  173. {
  174. return 1;
  175. }
  176.  
  177. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  178. {
  179. return 1;
  180. }
  181.  
  182. public OnPlayerSelectedMenuRow(playerid, row)
  183. {
  184. return 1;
  185. }
  186.  
  187. public OnPlayerExitedMenu(playerid)
  188. {
  189. return 1;
  190. }
  191.  
  192. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  193. {
  194. return 1;
  195. }
  196.  
  197. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  198. {
  199. return 1;
  200. }
  201.  
  202. public OnRconLoginAttempt(ip[], password[], success)
  203. {
  204. return 1;
  205. }
  206.  
  207. public OnPlayerUpdate(playerid)
  208. {
  209. return 1;
  210. }
  211.  
  212. public OnPlayerStreamIn(playerid, forplayerid)
  213. {
  214. return 1;
  215. }
  216.  
  217. public OnPlayerStreamOut(playerid, forplayerid)
  218. {
  219. return 1;
  220. }
  221.  
  222. public OnVehicleStreamIn(vehicleid, forplayerid)
  223. {
  224. return 1;
  225. }
  226.  
  227. public OnVehicleStreamOut(vehicleid, forplayerid)
  228. {
  229. return 1;
  230. }
  231.  
  232. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  233. {
  234. return 1;
  235. }
  236.  
  237. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  238. {
  239. return 1;
  240. }
Advertisement
Add Comment
Please, Sign In to add comment