Guest User

Untitled

a guest
Mar 8th, 2015
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.42 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3. #include <sscanf2>
  4.  
  5. new hit[MAX_PLAYERS];
  6. new isHitman[MAX_PLAYERS];
  7.  
  8. public OnGameModeInit()
  9. {
  10.     SetGameModeText("Hitman tutorial");
  11.     AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  12.     return 1;
  13. }
  14.  
  15. public OnGameModeExit()
  16. {
  17.     return 1;
  18. }
  19.  
  20. public OnPlayerRequestClass(playerid, classid)
  21. {
  22.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  23.     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  24.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  25.     return 1;
  26. }
  27.  
  28. COMMAND:contract(playerid, params[])
  29. {
  30.     new id, amount;
  31.     if(sscanf(params, "ui", id, amount)) return SendClientMessage(playerid, -1, "{A3A1A0}Usage: /contract [id] [amount]");
  32.     if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, "{A3A1A0}That player is not connected.");
  33.     if(isHitman[playerid] == 1) return SendClientMessage(playerid, -1, "{A3A1A0}Hitmen can not place contracts.");
  34.     if(isHitman[id] == 1) return SendClientMessage(playerid, -1, "{A3A1A0}That player already has the maximum hit on him.");
  35.     if(hit[id] == 150000 || hit[id] > 150000) return SendClientMessage(playerid, -1, "{A3A1A0}That player already has the maximum hit on him.");
  36.     if(amount < 50000 || amount > 150000) return SendClientMessage(playerid, -1, "{A3A1A0}Hits range from $50,000 - $150,000.");
  37.     if(hit[id] + amount > 150000) return SendClientMessage(playerid, -1, "{A3A1A0}That hit is too high for this player, please lower it.");
  38.     hit[id] = hit[id] + amount;
  39.    
  40.     new result[128];
  41.     new tname[MAX_PLAYER_NAME];
  42.     GetPlayerName(id, tname, sizeof(tname));
  43.     format(result, sizeof(result), "You have placed a hit of $%i on %s.", amount, tname);
  44.     SendClientMessage(playerid, -1, result);
  45.    
  46.     new string[128];
  47.     format(string, sizeof(string), "HITMAN: A new hit is available. Name: %s | Amount: $%i", tname, hit[id]);
  48.     for(new i = 0; i < MAX_PLAYERS; i++)
  49.     {
  50.         if(IsPlayerConnected(i))
  51.         {
  52.             if(isHitman[i])
  53.             {
  54.                 SendClientMessage(i, -1, string);
  55.             }
  56.         }
  57.     }
  58.     return 1;
  59. }
  60.  
  61. COMMAND:hits(playerid, params[])
  62. {
  63.     if(isHitman[playerid] == 1)
  64.     {
  65.         SendClientMessage(playerid, -1, "--- Current available contracts ---");
  66.        
  67.         new string[128];
  68.         new tname[MAX_PLAYER_NAME];
  69.         for(new i = 0; i < MAX_PLAYERS; i++)
  70.         {
  71.             if(IsPlayerConnected(i))
  72.             {
  73.                 if(hit[i] > 0)
  74.                 {
  75.                     format(string, sizeof(string), "Name: %s | Amount: %i", tname, hit[i]);
  76.                     SendClientMessage(playerid, -1, string);
  77.                 }
  78.             }
  79.         }
  80.     }
  81.     return 1;
  82. }
  83.  
  84. public OnPlayerConnect(playerid)
  85. {
  86.     return 1;
  87. }
  88.  
  89. public OnPlayerDisconnect(playerid, reason)
  90. {
  91.     return 1;
  92. }
  93.  
  94. public OnPlayerSpawn(playerid)
  95. {
  96.     return 1;
  97. }
  98.  
  99. public OnPlayerDeath(playerid, killerid, reason)
  100. {
  101.     if(killerid != INVALID_PLAYER_ID)
  102.     {
  103.         if(isHitman[killerid] == 1)
  104.         {
  105.             if(hit[playerid] > 0)
  106.             {
  107.                 GivePlayerMoney(killerid, hit[playerid]);
  108.                
  109.                 new result[128];
  110.                 new tname[MAX_PLAYER_NAME];
  111.                 GetPlayerName(playerid, tname, sizeof(tname));
  112.                 format(result, sizeof(result), "HITMAN: You killed %s and collected the hit of $%i!", tname, hit[playerid]);
  113.                 SendClientMessage(playerid, -1, result);
  114.                 hit[playerid] = 0;
  115.             }
  116.         }
  117.     }
  118.     return 1;
  119. }
  120.  
  121. public OnVehicleSpawn(vehicleid)
  122. {
  123.     return 1;
  124. }
  125.  
  126. public OnVehicleDeath(vehicleid, killerid)
  127. {
  128.     return 1;
  129. }
  130.  
  131. public OnPlayerText(playerid, text[])
  132. {
  133.     return 1;
  134. }
  135.  
  136. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  137. {
  138.     return 1;
  139. }
  140.  
  141. public OnPlayerExitVehicle(playerid, vehicleid)
  142. {
  143.     return 1;
  144. }
  145.  
  146. public OnPlayerStateChange(playerid, newstate, oldstate)
  147. {
  148.     return 1;
  149. }
  150.  
  151. public OnPlayerEnterCheckpoint(playerid)
  152. {
  153.     return 1;
  154. }
  155.  
  156. public OnPlayerLeaveCheckpoint(playerid)
  157. {
  158.     return 1;
  159. }
  160.  
  161. public OnPlayerEnterRaceCheckpoint(playerid)
  162. {
  163.     return 1;
  164. }
  165.  
  166. public OnPlayerLeaveRaceCheckpoint(playerid)
  167. {
  168.     return 1;
  169. }
  170.  
  171. public OnRconCommand(cmd[])
  172. {
  173.     return 1;
  174. }
  175.  
  176. public OnPlayerRequestSpawn(playerid)
  177. {
  178.     return 1;
  179. }
  180.  
  181. public OnObjectMoved(objectid)
  182. {
  183.     return 1;
  184. }
  185.  
  186. public OnPlayerObjectMoved(playerid, objectid)
  187. {
  188.     return 1;
  189. }
  190.  
  191. public OnPlayerPickUpPickup(playerid, pickupid)
  192. {
  193.     return 1;
  194. }
  195.  
  196. public OnVehicleMod(playerid, vehicleid, componentid)
  197. {
  198.     return 1;
  199. }
  200.  
  201. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  202. {
  203.     return 1;
  204. }
  205.  
  206. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  207. {
  208.     return 1;
  209. }
  210.  
  211. public OnPlayerSelectedMenuRow(playerid, row)
  212. {
  213.     return 1;
  214. }
  215.  
  216. public OnPlayerExitedMenu(playerid)
  217. {
  218.     return 1;
  219. }
  220.  
  221. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  222. {
  223.     return 1;
  224. }
  225.  
  226. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  227. {
  228.     return 1;
  229. }
  230.  
  231. public OnRconLoginAttempt(ip[], password[], success)
  232. {
  233.     return 1;
  234. }
  235.  
  236. public OnPlayerUpdate(playerid)
  237. {
  238.     return 1;
  239. }
  240.  
  241. public OnPlayerStreamIn(playerid, forplayerid)
  242. {
  243.     return 1;
  244. }
  245.  
  246. public OnPlayerStreamOut(playerid, forplayerid)
  247. {
  248.     return 1;
  249. }
  250.  
  251. public OnVehicleStreamIn(vehicleid, forplayerid)
  252. {
  253.     return 1;
  254. }
  255.  
  256. public OnVehicleStreamOut(vehicleid, forplayerid)
  257. {
  258.     return 1;
  259. }
  260.  
  261. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  262. {
  263.     return 1;
  264. }
  265.  
  266. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  267. {
  268.     return 1;
  269. }
Advertisement
Add Comment
Please, Sign In to add comment