Rei_Ayanami

Nayan's Samp Event's System

Apr 27th, 2024
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // NAYANthegamer Event System
  2. // My Discord : nayanthegamer
  3. // MY Discord Server : https://discord.gg/ASxc2xznzr
  4.  
  5. #include <a_samp>
  6. #include <streamer>
  7. #include <izcmd.inc>
  8.  
  9. new bool: Sniper[MAX_PLAYERS];
  10. new bool: M4Devil[MAX_PLAYERS];
  11. new bool: CarGO[MAX_PLAYERS];
  12. new bool: InEvent[MAX_PLAYERS];
  13.  
  14. public OnFilterScriptInit()
  15. {
  16.     print("------------------------");
  17.     print(" Nayan's Event's loaded ");
  18.     print("------------------------");
  19.    
  20.     CreatePickup(335 ,3 ,-3461.0330,1664.3850,66.0415 ,0);
  21.     CreatePickup(358 ,3 ,-3438.0564,1785.6772,66.0611 ,0);
  22.     CreatePickup(336 ,3 ,-3392.3962,1784.3801,66.2538 ,0);
  23.     CreatePickup(337 ,3 ,-3322.5183,1795.5392,66.0571 ,0);
  24.     CreatePickup(373 ,3 ,-3314.3315,1763.0685,63.7973 ,0);
  25.     CreatePickup(373 ,3 ,-3430.4739,1741.4113,66.0415 ,0);
  26.     CreatePickup(1240,3 ,-3388.9763,1698.1442,66.0415 ,0);
  27.     CreatePickup(348 ,3 ,-3428.8203,1833.9652,46.0349 ,0);
  28.     CreatePickup(321 ,3 ,-3434.0183,1687.8445,71.7817 ,0);
  29.     return 1;
  30. }
  31.  
  32. public OnFilterScriptExit()
  33. {
  34.     return 1;
  35. }
  36.  
  37. public OnPlayerConnect(playerid)
  38. {
  39.     return 1;
  40. }
  41.  
  42. public OnPlayerDisconnect(playerid, reason)
  43. {
  44.     return 1;
  45. }
  46.  
  47. public OnPlayerSpawn(playerid)
  48. {
  49.     if(Sniper[playerid] == true)
  50.     {
  51.         ResetPlayerWeapons(playerid);
  52.         Eventpackage(playerid);
  53.         new Spawn = random(5);
  54.         SetPlayerVirtualWorld(playerid, 23);
  55.         SetPlayerInterior(playerid, 0);
  56.         switch(Spawn)
  57.         {
  58.           case 0:
  59.           {
  60.              SetPlayerPos(playerid, -3305.5742,1710.9148,66.0415);
  61.              SetPlayerFacingAngle(playerid,99.8405);
  62.           }
  63.           case 1:
  64.           {
  65.              SetPlayerPos(playerid, -3381.3835,1659.4771,66.0415);
  66.              SetPlayerFacingAngle(playerid,335.6967);
  67.           }
  68.           case 2:
  69.           {
  70.              SetPlayerPos(playerid, -3446.7915,1680.2152,66.0805);
  71.              SetPlayerFacingAngle(playerid,348.8568);
  72.           }
  73.           case 3:
  74.           {
  75.              SetPlayerPos(playerid, -3435.3967,1782.2611,66.0415);
  76.              SetPlayerFacingAngle(playerid,186.1098);
  77.           }
  78.           case 4:
  79.           {
  80.              SetPlayerPos(playerid, -3391.7485,1782.7319,66.2633);
  81.              SetPlayerFacingAngle(playerid,347.1021);
  82.           }
  83.           case 5:
  84.           {
  85.              SetPlayerPos(playerid, -3316.2441,1793.5986,66.0571);
  86.              SetPlayerFacingAngle(playerid,171.1949);
  87.           }
  88.         }
  89.     }
  90.  
  91.     if(M4Devil[playerid] == true)
  92.     {
  93.         ResetPlayerWeapons(playerid);
  94.         M4package(playerid);
  95.         new Spawn = random(4);
  96.         SetPlayerVirtualWorld(playerid, 23);
  97.         SetPlayerInterior(playerid, 0);
  98.         switch(Spawn)
  99.         {
  100.           case 0:
  101.           {
  102.              SetPlayerPos(playerid, 942.4122,-1125.9700,23.9203);
  103.              SetPlayerFacingAngle(playerid,100.5680);
  104.           }
  105.           case 1:
  106.           {
  107.              SetPlayerPos(playerid, 857.3309,-1076.1945,24.2969);
  108.              SetPlayerFacingAngle(playerid,150.1377);
  109.           }
  110.           case 2:
  111.           {
  112.              SetPlayerPos(playerid, 947.6115,-1064.5311,24.8468);
  113.              SetPlayerFacingAngle(playerid,39.1540);
  114.           }
  115.           case 3:
  116.           {
  117.              SetPlayerPos(playerid, 844.1850,-1121.9656,23.9957);
  118.              SetPlayerFacingAngle(playerid,298.8471);
  119.           }
  120.           case 4:
  121.           {
  122.              SetPlayerPos(playerid, 814.9786,-1104.4783,25.7893);
  123.              SetPlayerFacingAngle(playerid,266.8242);
  124.           }
  125.         }
  126.     }
  127.     if(CarGO[playerid] == true)
  128.     {
  129.         ResetPlayerWeapons(playerid);
  130.         Cgwpackage(playerid);
  131.         new Spawn = random(7);
  132.         SetPlayerVirtualWorld(playerid, 23);
  133.         SetPlayerInterior(playerid, 0);
  134.         switch(Spawn)
  135.         {
  136.           case 0:
  137.           {
  138.              SetPlayerPos(playerid, -2338.9175,1559.7839,17.3281);
  139.              SetPlayerFacingAngle(playerid,89.0225);
  140.           }
  141.           case 1:
  142.           {
  143.              SetPlayerPos(playerid, -2388.0242,1553.9193,26.0469);
  144.              SetPlayerFacingAngle(playerid,2.9824);
  145.           }
  146.           case 2:
  147.           {
  148.              SetPlayerPos(playerid, -2417.9946,1554.1469,26.0469);
  149.              SetPlayerFacingAngle(playerid,64.8350);
  150.           }
  151.           case 3:
  152.           {
  153.              SetPlayerPos(playerid, -2474.6680,1545.1694,23.6547);
  154.              SetPlayerFacingAngle(playerid,0.7890);
  155.           }
  156.           case 4:
  157.           {
  158.              SetPlayerPos(playerid, -2470.8979,1538.4127,33.2344);
  159.              SetPlayerFacingAngle(playerid,282.7056);
  160.           }
  161.           case 5:
  162.           {
  163.              SetPlayerPos(playerid, -2370.8237,1534.9347,10.8209);
  164.              SetPlayerFacingAngle(playerid,53.3525);
  165.           }
  166.           case 6:
  167.           {
  168.              SetPlayerPos(playerid, -2427.1716,1536.6287,2.1172);
  169.              SetPlayerFacingAngle(playerid,26.0062);
  170.           }
  171.           case 7:
  172.           {
  173.              SetPlayerPos(playerid, -2389.6401,1551.5474,2.1172);
  174.              SetPlayerFacingAngle(playerid,6.7050);
  175.           }
  176.         }
  177.     }
  178.     return 1;
  179. }
  180.  
  181. public OnPlayerDeath(playerid, killerid, reason)
  182. {
  183.     if(InEvent[playerid] == true)
  184.     {
  185.         new string[128];
  186.         new Killername[22];
  187.         GetPlayerName(killerid, Killername, sizeof(Killername));
  188.         format(string, sizeof(string), "~g~You were killed by ~n~~w~ %s", Killername);
  189.         GameTextForPlayer(playerid, string, 2500, 3);
  190.         GivePlayerMoney(playerid, 250);
  191.         return 1;
  192.     }
  193.     return 1;
  194. }
  195.  
  196. public OnVehicleSpawn(vehicleid)
  197. {
  198.     return 1;
  199. }
  200.  
  201. public OnVehicleDeath(vehicleid, killerid)
  202. {
  203.     return 1;
  204. }
  205. //------------------------------------------------------------------------------
  206. //commands
  207. CMD:sniper(playerid, params[])
  208. {
  209.     if(InEvent[playerid] == true) return SendClientMessage(playerid, 0xff0080FF, "** You already joined a Minigame");
  210.     {
  211.         SpawnPlayer(playerid);
  212.         ResetPlayerWeapons(playerid);
  213.         Sniper[playerid] = true;
  214.         InEvent[playerid] = true;
  215.         Eventpackage(playerid);
  216.         new string[128];
  217.         new name[22];
  218.         GetPlayerName(playerid, name, sizeof(name));
  219.         format(string, sizeof(string), "** %s has joined the event Sniper Island to join (/sniper)", name);
  220.         SendClientMessageToAll(0xff0000FF, string);
  221.     }
  222.     return 1;
  223. }
  224.  
  225. CMD:m4(playerid, params[])
  226. {
  227.     if(InEvent[playerid] == true) return SendClientMessage(playerid, 0xff0080FF, "** You already joined a Minigame");
  228.     {
  229.         SpawnPlayer(playerid);
  230.         ResetPlayerWeapons(playerid);
  231.         M4Devil[playerid] = true;
  232.         InEvent[playerid] = true;
  233.         M4package(playerid);
  234.         new string[128];
  235.         new name[22];
  236.         GetPlayerName(playerid, name, sizeof(name));
  237.         format(string, sizeof(string), "** %s has joined the event M4 Devil to join (/m4)", name);
  238.         SendClientMessageToAll(0xff0000FF, string);
  239.     }
  240.     return 1;
  241. }
  242.  
  243. CMD:cgw(playerid, params[])
  244. {
  245.     if(InEvent[playerid] == true) return SendClientMessage(playerid, 0xff0080FF, "** You already joined a Minigame");
  246.     {
  247.         SpawnPlayer(playerid);
  248.         ResetPlayerWeapons(playerid);
  249.         CarGO[playerid] = true;
  250.         InEvent[playerid] = true;
  251.         Cgwpackage(playerid);
  252.         new string[128];
  253.         new name[22];
  254.         GetPlayerName(playerid, name, sizeof(name));
  255.         format(string, sizeof(string), "** %s has joined the event Car Go Wars to join (/cgw)", name);
  256.         SendClientMessageToAll(0xff0000FF, string);
  257.     }
  258.     return 1;
  259. }
  260.  
  261. CMD:exit(playerid, params[])
  262. {
  263.     if(InEvent[playerid] == true)
  264.     {
  265.         Sniper[playerid] = false;
  266.         M4Devil[playerid] = false;
  267.         CarGO[playerid] = false;
  268.         InEvent[playerid] = false;
  269.         SetPlayerInterior(playerid, 0);
  270.         SetPlayerVirtualWorld(playerid, 0);
  271.         SendClientMessage(playerid, 0xf0ff00FF, "Your exit from minitgame");
  272.         SpawnPlayer(playerid);
  273.     }
  274.     else return SendClientMessage(playerid, 0xf0ff00FF, "** Your not on any minigame");
  275.     return 1;
  276. }
  277. //------------------------------------------------------------------------------
  278.  
  279. public OnPlayerText(playerid, text[])
  280. {
  281.     return 1;
  282. }
  283.  
  284. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  285. {
  286.     if(InEvent[playerid] == true) return 1;
  287.     {
  288.         new Float:x,Float:y,Float:z;
  289.         GetPlayerPos(playerid, x, y, z);
  290.         SetPlayerPos(playerid, x, y, z);
  291.         SendClientMessage(playerid, 0xF6F600AA , "Currently your on a minigame you can't enter on vehicle");
  292.         ShowPlayerDialog(playerid, 93334, DIALOG_STYLE_MSGBOX, "Minigame", "{ffffff}Your kicked from Minigame \n\
  293.                                                                             {ffffff}Kicked By: {ff0000} Server \n\
  294.                                                                             {ffffff}Reason: {ff0000}Enter on vehicle", "Close", "");
  295.         KickPlayerFromEvent(playerid);
  296.         SpawnPlayer(playerid);
  297.     }
  298.     return 1;
  299. }
  300.  
  301. public OnPlayerExitVehicle(playerid, vehicleid)
  302. {
  303.     return 1;
  304. }
  305.  
  306. public OnRconCommand(cmd[])
  307. {
  308.     return 1;
  309. }
  310.  
  311. public OnPlayerPickUpPickup(playerid, pickupid)
  312. {
  313.     return 1;
  314. }
  315.  
  316. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  317. {
  318.     return 1;
  319. }
  320.  
  321. public OnRconLoginAttempt(ip[], password[], success)
  322. {
  323.     return 1;
  324. }
  325.  
  326. public OnPlayerUpdate(playerid)
  327. {
  328.     return 1;
  329. }
  330.  
  331. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  332. {
  333.     return 1;
  334. }
  335.  
  336. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  337. {
  338.     new string[128];
  339.     new rname[MAX_PLAYER_NAME];
  340.     new Float:x,Float:y,Float:z;
  341.    
  342.     GetPlayerName(clickedplayerid, rname, sizeof(rname));
  343.     GetPlayerPos(playerid, x, y, z);
  344.     GetPlayerInterior(playerid);
  345.    
  346.     if(InEvent[clickedplayerid] == true) return 1;
  347.     {
  348.         PlayerSpectatePlayer(playerid, clickedplayerid, SPECTATE_MODE_NORMAL);
  349.         format(string, sizeof(string), "** Your Spectate %s (Id:%d) if you want to get back so click on your self" , rname, clickedplayerid);
  350.         SendClientMessage(playerid, 0xF6F600AA , string);
  351.     }
  352.     if(clickedplayerid == playerid)
  353.     {
  354.         TogglePlayerSpectating(playerid,0);
  355.         SetPlayerPos(playerid, x, y, z);
  356.     }
  357.     return 1;
  358. }
  359.  
  360. Eventpackage(playerid)
  361. {
  362. GivePlayerWeapon(playerid, 34, 999999999);
  363. SetPlayerArmour(playerid, 100);
  364. SetPlayerHealth(playerid, 100);
  365. }
  366.  
  367. KickPlayerFromEvent(playerid)
  368. {
  369. Sniper[playerid] = false;
  370. M4Devil[playerid] = false;
  371. CarGO[playerid] = false;
  372. InEvent[playerid] = false;
  373. }
  374.  
  375. M4package(playerid)
  376. {
  377. GivePlayerWeapon(playerid, 31, 999999999);
  378. SetPlayerHealth(playerid, 100);
  379. SetPlayerArmour(playerid, 100);
  380. SetPlayerTime(playerid, 2, 42);
  381. }
  382.  
  383. Cgwpackage(playerid)
  384. {
  385. GivePlayerWeapon(playerid, 5, 1);
  386. GivePlayerWeapon(playerid, 23, 9999);
  387. GivePlayerWeapon(playerid, 25, 9999);
  388. GivePlayerWeapon(playerid, 39, 2);
  389. SetPlayerHealth(playerid, 100);
  390. SetPlayerArmour(playerid, 100);
  391. }
  392.  
  393. //This System made my NAYANthegamer ( aka Martin )
Add Comment
Please, Sign In to add comment