SHARE
TWEET

tutorial4.pwn

Chainksain Apr 8th, 2020 211 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <a_samp>
  2. #include <sscanf2>
  3. #include <zcmd>
  4.  
  5. #define function%0(%1) forward %0(%1); public %0(%1)
  6.  
  7. main()
  8. {
  9.     print("\n----------------------------------");
  10.     print(" Blank Gamemode by your name here");
  11.     print("----------------------------------\n");
  12. }
  13.  
  14. public OnGameModeInit()
  15. {
  16.     SetGameModeText("Blank Script");
  17.     AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  18.     return 1;
  19. }
  20.  
  21. public OnGameModeExit()
  22. {
  23.     return 1;
  24. }
  25.  
  26. public OnPlayerRequestClass(playerid, classid)
  27. {
  28.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  29.     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  30.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  31.     return 1;
  32. }
  33.  
  34. public OnPlayerConnect(playerid)
  35. {
  36.     return 1;
  37. }
  38.  
  39. public OnPlayerDisconnect(playerid, reason)
  40. {
  41.     new rsnstr[3][] =
  42.     {
  43.         "Timeout/Crash",
  44.         "Saiu",
  45.         "Kickado/Banido"
  46.     };
  47.     new string[64];
  48.     format(string, sizeof(string), "%s se desconectou (%s)", GetPlayerNameEx(playerid), rsnstr[reason]);
  49.     SendClientMessageToAll(-1, string);
  50.     return 1;
  51. }
  52.  
  53. public OnPlayerSpawn(playerid)
  54. {
  55.     return 1;
  56. }
  57.  
  58. public OnPlayerDeath(playerid, killerid, reason)
  59. {
  60.     return 1;
  61. }
  62.  
  63. public OnVehicleSpawn(vehicleid)
  64. {
  65.     return 1;
  66. }
  67.  
  68. public OnVehicleDeath(vehicleid, killerid)
  69. {
  70.     return 1;
  71. }
  72.  
  73. public OnPlayerText(playerid, text[])
  74. {
  75.     return 1;
  76. }
  77.  
  78. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  79. {
  80.     return 1;
  81. }
  82.  
  83. public OnPlayerExitVehicle(playerid, vehicleid)
  84. {
  85.     return 1;
  86. }
  87.  
  88. public OnPlayerStateChange(playerid, newstate, oldstate)
  89. {
  90.     return 1;
  91. }
  92.  
  93. public OnPlayerEnterCheckpoint(playerid)
  94. {
  95.     return 1;
  96. }
  97.  
  98. public OnPlayerLeaveCheckpoint(playerid)
  99. {
  100.     return 1;
  101. }
  102.  
  103. public OnPlayerEnterRaceCheckpoint(playerid)
  104. {
  105.     return 1;
  106. }
  107.  
  108. public OnPlayerLeaveRaceCheckpoint(playerid)
  109. {
  110.     return 1;
  111. }
  112.  
  113. public OnRconCommand(cmd[])
  114. {
  115.     return 1;
  116. }
  117.  
  118. public OnPlayerRequestSpawn(playerid)
  119. {
  120.     return 1;
  121. }
  122.  
  123. public OnObjectMoved(objectid)
  124. {
  125.     return 1;
  126. }
  127.  
  128. public OnPlayerObjectMoved(playerid, objectid)
  129. {
  130.     return 1;
  131. }
  132.  
  133. public OnPlayerPickUpPickup(playerid, pickupid)
  134. {
  135.     return 1;
  136. }
  137.  
  138. public OnVehicleMod(playerid, vehicleid, componentid)
  139. {
  140.     return 1;
  141. }
  142.  
  143. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  144. {
  145.     return 1;
  146. }
  147.  
  148. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  149. {
  150.     return 1;
  151. }
  152.  
  153. public OnPlayerSelectedMenuRow(playerid, row)
  154. {
  155.     return 1;
  156. }
  157.  
  158. public OnPlayerExitedMenu(playerid)
  159. {
  160.     return 1;
  161. }
  162.  
  163. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  164. {
  165.     return 1;
  166. }
  167.  
  168. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  169. {
  170.     return 1;
  171. }
  172.  
  173. public OnRconLoginAttempt(ip[], password[], success)
  174. {
  175.     return 1;
  176. }
  177.  
  178. public OnPlayerUpdate(playerid)
  179. {
  180.     return 1;
  181. }
  182.  
  183. public OnPlayerStreamIn(playerid, forplayerid)
  184. {
  185.     return 1;
  186. }
  187.  
  188. public OnPlayerStreamOut(playerid, forplayerid)
  189. {
  190.     return 1;
  191. }
  192.  
  193. public OnVehicleStreamIn(vehicleid, forplayerid)
  194. {
  195.     return 1;
  196. }
  197.  
  198. public OnVehicleStreamOut(vehicleid, forplayerid)
  199. {
  200.     return 1;
  201. }
  202.  
  203. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  204. {
  205.     return 1;
  206. }
  207.  
  208. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  209. {
  210.     return 1;
  211. }
  212.  
  213. // PROCEDIMENTOS
  214.  
  215. stock GetPlayerNameEx(playerid)
  216. {
  217.     new PlayerName[MAX_PLAYER_NAME];
  218.     GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
  219.     return PlayerName;
  220. }
  221.  
  222. function Float:GetPlayerHealthEx(playerid)
  223. {
  224.     new Float:health;
  225.     GetPlayerHealth(playerid, health);
  226.     return health;
  227. }
  228.  
  229. function Float:GetPlayerArmourEx(playerid)
  230. {
  231.     new Float:armor;
  232.     GetPlayerArmour(playerid, armor);
  233.     return armor;
  234. }
  235.  
  236. // COMANDOS
  237.  
  238. CMD:pos(playerid, params[]) // /pos [id] [x] [y] [z]
  239. {
  240.     new Float:pos[3], giveplayerid;
  241.     if(sscanf(params, "ufff", giveplayerid, pos[0], pos[1], pos[2]))
  242.         return SendClientMessage(playerid, -1, "USO: /pos [id] [x] [y] [z]");
  243.  
  244.     if(!IsPlayerConnected(giveplayerid) || giveplayerid == INVALID_PLAYER_ID)
  245.         return SendClientMessage(playerid, -1, "ERRO: ID Inválido!");
  246.  
  247.     SetPlayerPos(giveplayerid, pos[0], pos[1], pos[2]);
  248.     return 1;
  249. }
  250.  
  251. CMD:info(playerid, params[])
  252. {
  253.     new giveplayerid, string[64];
  254.    
  255.     if(sscanf(params, "u", giveplayerid))
  256.         return SendClientMessage(playerid, -1, "USO: /info [id]");
  257.    
  258.     if(!IsPlayerConnected(giveplayerid) || giveplayerid == INVALID_PLAYER_ID)
  259.         return SendClientMessage(playerid, -1, "ERRO: ID Inválido!");
  260.  
  261.     format(string, sizeof(string), "Jogador: %s", GetPlayerNameEx(giveplayerid));
  262.     SendClientMessage(playerid, -1, string);
  263.  
  264.     format(string, sizeof(string), "ID: %d", giveplayerid);
  265.     SendClientMessage(playerid, -1, string);
  266.  
  267.     format(string, sizeof(string), "Score: %d", GetPlayerScore(giveplayerid));
  268.     SendClientMessage(playerid, -1, string);
  269.  
  270.     format(string, sizeof(string), "Dinheiro: %d", GetPlayerMoney(giveplayerid));
  271.     SendClientMessage(playerid, -1, string);
  272.        
  273.     format(string, sizeof(string), "Life: %f", GetPlayerHealthEx(giveplayerid));
  274.     SendClientMessage(playerid, -1, string);
  275.  
  276.     format(string, sizeof(string), "Armor: %f", GetPlayerArmourEx(giveplayerid));
  277.     SendClientMessage(playerid, -1, string);
  278.  
  279.     new Float:pos[3];
  280.     GetPlayerPos(giveplayerid, pos[0], pos[1], pos[2]);
  281.     format(string, sizeof(string), "PosX: %f PosY: %f PosZ: %f", pos[0], pos[1], pos[2]);
  282.     SendClientMessage(playerid, -1, string);
  283.  
  284.     format(string, sizeof(string),"Int: %d", GetPlayerInterior(giveplayerid));
  285.     SendClientMessage(playerid, -1, string);
  286.  
  287.     format(string, sizeof(string),"Virtual World: %d", GetPlayerVirtualWorld(giveplayerid));
  288.     SendClientMessage(playerid, -1, string);
  289.  
  290.     return 1;
  291. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top