Linux-VServer pastebin service

Posted by Conor_M on Fri 4th Jul 07:48 (modification of post by QzZblLzVmWkCOWhX view diff)
diff | download | new post

  1. #include <a_samp>              // SAMP main functs include  
  2.  
  3. #include <core>   // PAWN main functs (if, else lol.)  
  4.  
  5. #include <file>   // File Actions (req.)  
  6.  
  7. #include <float>                // mathmatics  
  8.  
  9. #include <dprop>                // DProp  
  10.  
  11. #include <dutils>              // DUtils  
  12.  
  13. #include <dudb>   // DUDB  
  14.  
  15. #include <a_irc>                // IRC Include  
  16.  
  17. #include <cpstream> //Makatra's Checkpoint streamer  
  18.  
  19. #include <vstream> //TaXi's Vehicle Streamer  
  20.  
  21. #pragma dynamic 8192    // 8192 :D  
  22.  
  23. #pragma tabsize 0             // Tab indent  
  24.  
  25.  
  26.  
  27. // COLOURS  
  28.  
  29.  
  30.  
  31. #define COLOR_GREY 0xAFAFAFAA  
  32.  
  33. #define COLOR_GREEN 0x33AA33AA  
  34.  
  35. #define COLOR_RED 0xAA3333AA  
  36.  
  37. #define COLOR_YELLOW 0xFFFF00AA  
  38.  
  39. #define COLOR_WHITE 0xFFFFFFAA  
  40.  
  41. #define COLOR_HELP 0xFFBA79FF  
  42.  
  43. #define COLOR_HELP2 0x9E1000FF  
  44.  
  45.  
  46.  
  47. new gTeam[MAX_PLAYERS];  
  48.  
  49. // TEAMS  
  50.  
  51.  
  52.  
  53. #define TEAM_COP        1  
  54.  
  55. #define TEAM_CIVIL      2  
  56.  
  57.  
  58.  
  59. // OTHER  
  60.  
  61.  
  62.  
  63. #define sversion "0.1" // just like BMUK's :p  
  64.  
  65.  
  66.  
  67. //NEW  
  68.  
  69. new bankentercp;  
  70.  
  71. new bankleavecp;  
  72.  
  73. new bankrobcp;  
  74.  
  75. new stupidsystem =0;  
  76.  
  77.  
  78.  
  79. // IRC Shit  
  80.  
  81. new EchoConnection;                     // This will hold the connection ID for messages.  
  82.  
  83. new EchoChan[25] = "#saroleplay.echo";  // This is the channel you want your echo to be in, as well as the !say command.  
  84.  
  85. new Connections = 0;  
  86.  
  87. new bool:TimerSet = false;  
  88.  
  89.  
  90.  
  91. //Forwards  
  92.  
  93. forward EventTimer();  
  94.  
  95. new aWeaponNames[][32] = {  
  96.  
  97.         {"Unarmed (Fist)"}, // 0  
  98.  
  99.         {"Brass Knuckles"}, // 1  
  100.  
  101.         {"Golf Club"}, // 2  
  102.  
  103.         {"Night Stick"}, // 3  
  104.  
  105.         {"Knife"}, // 4  
  106.  
  107.         {"Baseball Bat"}, // 5  
  108.  
  109.         {"Shovel"}, // 6  
  110.  
  111.         {"Pool Cue"}, // 7  
  112.  
  113.         {"Katana"}, // 8  
  114.  
  115.         {"Chainsaw"}, // 9  
  116.  
  117.         {"Purple Dildo"}, // 10  
  118.  
  119.         {"Big White Vibrator"}, // 11  
  120.  
  121.         {"Medium White Vibrator"}, // 12  
  122.  
  123.         {"Small White Vibrator"}, // 13  
  124.  
  125.         {"Flowers"}, // 14  
  126.  
  127.         {"Cane"}, // 15  
  128.  
  129.         {"Grenade"}, // 16  
  130.  
  131.         {"Teargas"}, // 17  
  132.  
  133.         {"Molotov"}, // 18  
  134.  
  135.         {" "}, // 19  
  136.  
  137.         {" "}, // 20  
  138.  
  139.         {" "}, // 21  
  140.  
  141.         {"Colt 45"}, // 22  
  142.  
  143.         {"Colt 45 (Silenced)"}, // 23  
  144.  
  145.         {"Desert Eagle"}, // 24  
  146.  
  147.         {"Normal Shotgun"}, // 25  
  148.  
  149.         {"Sawnoff Shotgun"}, // 26  
  150.  
  151.         {"Combat Shotgun"}, // 27  
  152.  
  153.         {"Micro Uzi"}, // 28  
  154.  
  155.         {"MP5"}, // 29  
  156.  
  157.         {"AK47"}, // 30  
  158.  
  159.         {"M4"}, // 31  
  160.  
  161.         {"Tec9"}, // 32  
  162.  
  163.         {"Country Rifle"}, // 33  
  164.  
  165.         {"Sniper Rifle"}, // 34  
  166.  
  167.         {"Rocket Launcher"}, // 35  
  168.  
  169.         {"Heat-Seeking Rocket Launcher"}, // 36  
  170.  
  171.         {"Flamethrower"}, // 37  
  172.  
  173.         {"Minigun"}, // 38  
  174.  
  175.         {"Satchel Charge"}, // 39  
  176.  
  177.         {"Detonator"}, // 40  
  178.  
  179.         {"Spray Can"}, // 41  
  180.  
  181.         {"Fire Extinguisher"}, // 42  
  182.  
  183.         {"Camera"}, // 43  
  184.  
  185.         {"Night Vision Goggles"}, // 44  
  186.  
  187.         {"Infrared Vision Goggles"}, // 45  
  188.  
  189.         {"Parachute"}, // 46  
  190.  
  191.         {"Fake Pistol"} // 47  
  192.  
  193. };  
  194.  
  195.  
  196.  
  197. new aDisconnectNames[][16] = {  
  198.  
  199.         {"Timeout"}, // 0  
  200.  
  201.         {"Left"}, // 1  
  202.  
  203.         {"Kicked"} // 2  
  204.  
  205. };  
  206.  
  207.  
  208.  
  209.  
  210.  
  211. // END IRC Shit  
  212.  
  213.  
  214.  
  215. new PLAYERLIST_authed[MAX_PLAYERS];  
  216.  
  217.  
  218.  
  219. // MAIN  
  220.  
  221.  
  222.  
  223. main()  
  224.  
  225. {  
  226.  
  227.         print("\n####################");  
  228.  
  229.         print("# Cops'N'Robbers   #");  
  230.  
  231.         print("# for NeoMrsir     #");  
  232.  
  233.         print("# developed by Rob #");  
  234.  
  235.         print("# & Conor                  #");  
  236.  
  237.         print("####################\n");  
  238.  
  239. }  
  240.  
  241.  
  242.  
  243. // The main part of the whole thing.  
  244.  
  245.  
  246.  
  247. SetPlayerTeamFromClass(playerid, classid)  
  248.  
  249. {  
  250.  
  251.         if (classid == 0)  
  252.  
  253.         {  
  254.  
  255.                 gTeam[playerid] = TEAM_COP;  
  256.  
  257.         }  
  258.  
  259.         else  
  260.  
  261.         {  
  262.  
  263.                 gTeam[playerid] = TEAM_CIVIL;  
  264.  
  265.         }  
  266.  
  267. }  
  268.  
  269. public OnGameModeInit()  
  270.  
  271. {  
  272.  
  273.     EchoConnection = ircConnect("extreme.nl.eu.gtanet.com", 6667, "RobTest");  
  274.  
  275.         SetGameModeText("Los Santos Role-play");  
  276.  
  277.         AllowInteriorWeapons(1);  
  278.  
  279.         EnableTirePopping(1);  
  280.  
  281.         EnableStuntBonusForAll(0);  
  282.  
  283.         SetWorldTime(8);  
  284.  
  285.         AllowAdminTeleport(1);  
  286.  
  287.         ircSay(EchoConnection, EchoChan,"5################");  
  288.  
  289.         ircSay(EchoConnection, EchoChan,"5Cops and Robbers");  
  290.  
  291.         ircSay(EchoConnection, EchoChan,"5Conor & Rob");  
  292.  
  293.         ircSay(EchoConnection, EchoChan,"5Version 0.1");  
  294.  
  295.     ircSay(EchoConnection, EchoChan,"5################");  
  296.  
  297.         // Start player classes  
  298.  
  299.         AddPlayerClass(281,1599.6644,-1708.5675,5.8906,45.8766,0,0,0,0,0,0); // Police Spawn  
  300.  
  301.     AddPlayerClass(29,2815.0498,2254.1252,10.8203,158.6954,0,0,0,0,0,0);  
  302.  
  303.     AddPlayerClass(181,2275.3997,-1785.8702,13.5469,89.0471,0,0,0,0,0,0); // New Spawn Loc - Civil  
  304.  
  305. AddPlayerClass(181,2065.2036,-1703.4658,14.1484,264.2793,0,0,0,0,0,0); // New Spawn Loc - Civil  
  306.  
  307. AddPlayerClass(181,2359.7185,-1312.6213,24.0064,310.5691,0,0,0,0,0,0); // New Spawn Loc - Civil  
  308.  
  309. AddPlayerClass(291,2434.1829,-1303.3793,24.9858,261.4407,0,0,0,0,0,0); // New Spawn Loc - Civil  
  310.  
  311. AddPlayerClass(291,2470.1445,-1295.3131,30.2332,84.7753,0,0,0,0,0,0); // New Spawn Loc - Civil  
  312.  
  313. AddPlayerClass(181,1417.7324,-1133.1401,23.4953,180.7773,0,0,0,0,0,0); // New Spawn Loc - Civil  
  314.  
  315. AddPlayerClass(181,823.0557,-1103.0114,25.7979,270.0880,0,0,0,0,0,0); // New Spawn Loc - Civil  
  316.  
  317. AddPlayerClass(181,893.0659,-1335.6842,13.5469,2.1434,0,0,0,0,0,0); // New Spawn Loc - Civil  
  318.  
  319. AddPlayerClass(181,673.1516,-1247.7721,14.3650,56.7577,0,0,0,0,0,0); // New Spawn Loc - Civil  
  320.  
  321. AddPlayerClass(181,1123.4525,-2036.9656,69.8871,273.2474,0,0,0,0,0,0); // New Spawn Loc - Civil  
  322.  
  323.         //End player classes  
  324.  
  325.  
  326.  
  327.         //Start Vehicles  
  328.  
  329. AddStaticVehicle(523,1600.8300,-1704.0439,5.4638,89.9668,0,0); // One Police HPV1000  
  330.  
  331. AddStaticVehicle(523,1600.4983,-1699.5339,5.4635,86.7882,0,0); // One Police HPV1000  
  332.  
  333. AddStaticVehicle(523,1600.4388,-1696.0068,5.4654,90.3233,0,0); // One Police HPV1000  
  334.  
  335. AddStaticVehicle(523,1600.3992,-1692.3007,5.4605,88.7182,0,0); // One Police HPV1000  
  336.  
  337. AddStaticVehicle(596,1544.3599,-1651.3058,5.6115,89.6101,0,1); // Police Car One  
  338.  
  339. AddStaticVehicle(596,1544.5201,-1655.1956,5.6125,88.3698,0,1); // Police Car One  
  340.  
  341. AddStaticVehicle(596,1543.8760,-1659.3077,5.6125,87.7498,0,1); // Police Car One  
  342.  
  343. AddStaticVehicle(596,1543.6902,-1663.4481,5.6099,89.0979,0,1); // Police Car One  
  344.  
  345. AddStaticVehicle(596,1544.4989,-1667.7994,5.6117,90.9153,0,1); // Police Car One  
  346.  
  347. AddStaticVehicle(596,1543.4319,-1672.0778,5.6109,89.5247,0,1); // Police Car One  
  348.  
  349. AddStaticVehicle(596,1543.7888,-1676.1919,5.6120,88.7174,0,1); // Police Car One  
  350.  
  351. AddStaticVehicle(596,1543.6589,-1680.3679,5.6123,89.7398,0,1); // Police Car One  
  352.  
  353. AddStaticVehicle(596,1543.9994,-1685.0687,5.6133,89.7598,0,1); // Police Car One  
  354.  
  355. AddStaticVehicle(427,1569.5237,-1710.2285,6.0225,359.3815,0,1); // Enforcer one  
  356.  
  357. AddStaticVehicle(427,1574.7559,-1709.6052,6.0225,359.0456,0,1); // Enforcer one  
  358.  
  359. AddStaticVehicle(427,1578.5295,-1711.5361,6.0389,0.1667,0,1); // Enforcer one  
  360.  
  361. AddStaticVehicle(427,1583.3787,-1709.6965,6.0226,358.2485,0,1); // Enforcer one  
  362.  
  363. AddStaticVehicle(599,1595.0172,-1710.9618,6.0828,0.8374,0,1); // Ranger One  
  364.  
  365. AddStaticVehicle(599,1591.6152,-1708.7189,6.0797,359.6725,0,1); // Ranger Two  
  366.  
  367. AddStaticVehicle(599,1587.6787,-1709.4913,6.0728,358.3831,0,1); // Ranger Three  
  368.  
  369. AddStaticVehicle(599,1534.2983,-1645.4298,6.0786,178.8348,0,1); // Ranger Four  
  370.  
  371. AddStaticVehicle(599,1538.3138,-1645.1105,6.0827,177.9863,0,1); // Ranger Five  
  372.  
  373. AddStaticVehicle(490,1528.0930,-1688.0781,6.0185,269.8727,0,0); // FBI Rancher One  
  374.  
  375. AddStaticVehicle(490,1528.6882,-1684.1991,6.0159,271.2697,0,0); // FBI Rancher One  
  376.  
  377. AddStaticVehicle(490,1585.3507,-1678.8551,6.0236,270.5056,0,0); // FBI Rancher Three  
  378.  
  379. AddStaticVehicle(490,1585.6072,-1671.4529,6.0213,271.1496,0,0); // FBI Rancher Four  
  380.  
  381. // End vehicles  
  382.  
  383.  
  384.  
  385.  
  386.  
  387. //Start Checkpoints  
  388.  
  389. bankentercp = CPS_AddCheckpoint(595.0864,-1249.7955,18.2560,8.0,50);  
  390.  
  391. bankleavecp = CPS_AddCheckpoint(2304.6875,-16.1458,26.7422,2.0,8);  
  392.  
  393. bankrobcp = CPS_AddCheckpoint(2316.6196,-10.1047,26.7422,3.0,6);  
  394.  
  395. }  
  396.  
  397.  
  398.  
  399. public OnGameModeExit()  
  400.  
  401. {  
  402.  
  403.     ircDisconnect(EchoConnection);  
  404.  
  405.         return 1;  
  406.  
  407. }  
  408.  
  409. // IRC Shit  
  410.  
  411.  
  412.  
  413. public ircOnConnect(conn)  
  414.  
  415. {  
  416.  
  417.         // join the echo channel  
  418.  
  419.         if (!TimerSet) SetTimer("EventTimer", 500, 1);  // listen for callbacks from this channel  
  420.  
  421.         Connections++;                                  // save number of connections  
  422.  
  423.         ircJoinChan(conn, EchoChan);  
  424.  
  425. }  
  426.  
  427.  
  428.  
  429. //Start checkpoint entering.. err..  
  430.  
  431. public OnPlayerEnterCheckpoint(playerid)  
  432.  
  433. {  
  434.  
  435. new cpid = CPS_GetPlayerCheckpoint(playerid);  
  436.  
  437.  
  438.  
  439.  
  440.  
  441. if(cpid == bankentercp)  
  442.  
  443. {  
  444.  
  445.        SetPlayerPos(playerid,2310.1270,-15.4618,26.7496);  
  446.  
  447.            SetPlayerFacingAngle(playerid,272.8260);  
  448.  
  449.            SetCameraBehindPlayer(playerid);  
  450.  
  451.            }  
  452.  
  453.             
  454.  
  455. if(cpid == bankleavecp)  
  456.  
  457. {  
  458.  
  459. SetPlayerPos(playerid,602.8280,-1240.3810,18.2657);  
  460.  
  461. SetCameraBehindPlayer(playerid);  
  462.  
  463. }  
  464.  
  465. }  
  466.  
  467. public OnPlayerConnect(playerid)  
  468.  
  469. {  
  470.  
  471.         new str[100], str2[100], string[100];  
  472.  
  473.     GetPlayerName(playerid, str, 24);  
  474.  
  475.     format(str2, 100, "\2;%s(%d) has joined Los Santos Rolplay v%s\2;", str,playerid,sversion);  
  476.  
  477.         ircSay(EchoConnection, EchoChan,str2);  
  478.  
  479.         format(str, 100, "%s(%d) has joined Los Santos Roleplay v%s", str,playerid,sversion);  
  480.  
  481.     printf("%s",str);  
  482.  
  483.     for(new i=0; i<MAX_PLAYERS; i++) {  
  484.  
  485.         if(IsPlayerConnected(i) && i != playerid) {  
  486.  
  487.     SendClientMessage(i,0x808080AA, str);  
  488.  
  489.     stupidsystem =0;  
  490.  
  491.     }  
  492.  
  493.     }  
  494.  
  495.  
  496.  
  497.     SetPlayerColor(playerid,COLOR_GREY);  
  498.  
  499.      
  500.  
  501.     SetPlayerVirtualWorld(playerid,0);  
  502.  
  503.     /*format(string, sizeof(string), "Script Version %s",sversion);  
  504.  
  505.     SendClientMessage(playerid,COLOR_WHITE, string);  
  506.  
  507.     SendClientMessage(playerid,0x87CEEBAA, "Welcome.");  
  508.  
  509.         format(string, sizeof(string), "~w~Cop's and Robbers!~n~version %s",sversion);  
  510.  
  511.         GameTextForPlayer(playerid,string, 6000, 0); */  
  512.  
  513.         GameTextForPlayer(playerid,"~w~SARP & THE NEO MR SIR PROJECT GIVE YOU LOS SANTOS ROLEPLAY ",5000,5);  
  514.  
  515.         SendClientMessage(playerid,COLOR_HELP,"Welcome to Los Santos Roleplay! Check out /help to get a sense of direction, And /rules so you aren't confronted by the admins");  
  516.  
  517.         SendClientMessage(playerid,COLOR_HELP2,"Check out our forums & site at saroleplay.com");  
  518.  
  519.         SendClientMessage(playerid,COLOR_HELP,"Enjoy your stay! We hope it is a long one.");  
  520.  
  521.     return 1;  
  522.  
  523. }  
  524.  
  525. public OnPlayerSpawn(playerid)  
  526.  
  527. {  
  528.  
  529. SetPlayerInterior(playerid,0);  
  530.  
  531. }  
  532.  
  533.  
  534.  
  535. //START Vehicle Stuff  
  536.  
  537. public OnPlayerStateChange(playerid, newstate, oldstate)  
  538.  
  539. {  
  540.  
  541. if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) >= 0 && GetPlayerVehicleID(playerid) <= 25)  
  542.  
  543. {  
  544.  
  545. if(gTeam[playerid] != TEAM_COP)  
  546.  
  547. {  
  548.  
  549. //SetPlayerWantedLevel(playerid,+1);  
  550.  
  551. SendClientMessage(playerid, 0xA9A9A9AA, "|_Crime Commited_|");  
  552.  
  553. SendClientMessage(playerid, 0xA9A9A9AA, "Government Vehicle Theft");  
  554.  
  555. new plwl = GetPlayerWantedLevel(playerid);  
  556.  
  557. SetPlayerWantedLevel(playerid, plwl +4 );  
  558.  
  559. }  
  560.  
  561. }  
  562.  
  563. }  
  564.  
  565. //START COMMANDS  
  566.  
  567.  
  568.  
  569.  
  570.  
  571. public OnPlayerCommandText(playerid, cmdtext[])  
  572.  
  573. {  
  574.  
  575. new string[256];  
  576.  
  577. new get = CPS_GetPlayerCheckpoint(playerid);  
  578.  
  579.         new cmd[256];  
  580.  
  581.         new giveplayerid, idx;  
  582.  
  583.         new tmp[256];  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595. if(strcmp("/robbank", cmdtext, true) ==0)  
  596.  
  597. {  
  598.  
  599. if(get == bankrobcp)  
  600.  
  601. {  
  602.  
  603. SendClientMessage(playerid,COLOR_RED,"You aren't in the Los Santos Bank checkpoint!");  
  604.  
  605. }  
  606.  
  607. if(gTeam[playerid] == TEAM_COP && get == bankrobcp)  
  608.  
  609. {  
  610.  
  611. SendClientMessage(playerid,COLOR_RED,"You are a law enforcment officer - You cannot rob the Los Santos Bank!");  
  612.  
  613. }  
  614.  
  615.  
  616.  
  617. if(gTeam[playerid] == TEAM_CIVIL && get == bankrobcp)  
  618.  
  619. {  
  620.  
  621. new getcolor = GetPlayerColor(playerid);  
  622.  
  623. SendClientMessage(playerid,getcolor,"You have robbed the Los Santos Bank. Law Enforcment has been dispatched");  
  624.  
  625.                 new plwl = GetPlayerWantedLevel(playerid);  
  626.  
  627.             SetPlayerWantedLevel(playerid, plwl +4 );  
  628.  
  629.             new mrand = random(205000);  
  630.  
  631.             new pname[30];  
  632.  
  633.                 GetPlayerName(playerid, pname, 30);  
  634.  
  635.             format(string, sizeof(string), "%s(%d) Has robbed $%d from the Los Santos Bank",pname,playerid,mrand);  
  636.  
  637.                 SendClientMessageToAll(0x00C7FFAA, string);  
  638.  
  639.                 ircSay(EchoConnection, EchoChan,string);  
  640.  
  641.                 format(string, sizeof(string), "%s(%d) Has robbed $%d from the Los Santos Bank",pname,playerid,mrand);  
  642.  
  643.                 printf("%s", string);  
  644.  
  645.                 format(string, sizeof(string), "~w~ROBBERY ~w~COMPLETE~n~~b~YOU ROBBED~n~~r~ $%d~n~~w~FROM THE BANK", mrand);  
  646.  
  647.                 GameTextForPlayer(playerid, string, 7000, 3);  
  648.  
  649.                 new pcol = GetPlayerColor(playerid);  
  650.  
  651.               plwl = GetPlayerWantedLevel(playerid);  
  652.  
  653.                 SendClientMessage(playerid, 0xA9A9A9AA, "|_Crime Commited_|");  
  654.  
  655.                 format(string, sizeof(string), "(CASINO ROBBERY) Wanted Level %d",plwl);  
  656.  
  657.                 SendClientMessage(playerid,pcol,string);  
  658.  
  659.             GivePlayerMoney(playerid, mrand);  
  660.  
  661. }  
  662.  
  663. }  
  664.  
  665. }  
  666.  
  667.  
  668.  
  669. public OnPlayerDisconnect(playerid, reason)  
  670.  
  671. {  
  672.  
  673.     new msg[128];  
  674.  
  675.         new name[32];  
  676.  
  677.     GetPlayerName(playerid, name, sizeof(name));  
  678.  
  679.         format(msg, sizeof(msg), "\2;%s(%d) has left the server. Reason: (%s)\2;", name,playerid,aDisconnectNames[reason]);  
  680.  
  681.         ircSay(EchoConnection, EchoChan, msg);  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.     new ConnectName[30], str[100];  
  690.  
  691.         GetPlayerName(playerid, ConnectName, 30);  
  692.  
  693.     switch (reason) {  
  694.  
  695.         case 0: format(str, 256, "%s has left the server! (Timeout)", ConnectName);  
  696.  
  697.                 case 1: format(str, 256, "%s has left the server! (Leaving)", ConnectName);  
  698.  
  699.                 case 2: format(str, 256, "%s has left the server! (Kicked)", ConnectName);  
  700.  
  701.     }  
  702.  
  703.     SendClientMessageToAll(0x808080AA, str);  
  704.  
  705.     return 1;  
  706.  
  707. }  
  708.  
  709.  
  710.  
  711.  
  712.  
  713. public OnPlayerRequestClass(playerid, classid)  
  714.  
  715. {  
  716.  
  717.     SetPlayerTeamFromClass(playerid, classid);  
  718.  
  719.     SetPlayerColor(playerid,COLOR_GREY);  
  720.  
  721.      
  722.  
  723.     SetPlayerInterior(playerid,3);  
  724.  
  725.         SetPlayerPos(playerid,1206.9768,-32.5926,1000.9531);  
  726.  
  727.         SetPlayerFacingAngle(playerid,249.3010);  
  728.  
  729.         SetPlayerCameraPos(playerid,1209.1083,-33.8061,1000.9531);  
  730.  
  731.         SetPlayerCameraLookAt(playerid,1206.9768,-32.5926,1000.9531);  
  732.  
  733.          
  734.  
  735.      
  736.  
  737.  
  738.  
  739.         switch (classid) {  
  740.  
  741.  
  742.  
  743.                 case 1:  
  744.  
  745.                     {  
  746.  
  747.                                 GameTextForPlayer(playerid, "~b~POLICE OFFICER", 3000, 5);  
  748.  
  749.                         }  
  750.  
  751.                 case 2:  
  752.  
  753.                 {  
  754.  
  755.                                 GameTextForPlayer(playerid, "~w~CIVILIAN", 3000, 5);  
  756.  
  757.                         }  
  758.  
  759.  
  760.  
  761. }  
  762.  
  763.         return 1;  
  764.  
  765. }  
  766.  
  767.  
  768.  
  769. /*public OnPlayerRequestSpawn(playerid)  
  770.  
  771. {  
  772.  
  773.         return 1;  
  774.  
  775. }  
  776.  
  777. */  
  778.  
  779.  stock ircIsOp(conn,channel[],user[])  
  780.  
  781. {  
  782.  
  783.         new ircLevel[3];  
  784.  
  785.         ircGetUserLevel(conn, channel, user, ircLevel);  
  786.  
  787.         if(!strcmp(ircLevel, "~", true,1) || !strcmp(ircLevel, "&", true,1) || !strcmp(ircLevel, "@", true,1)) return 1;  
  788.  
  789.         return 0;  
  790.  
  791. }  
  792.  
  793.  
  794.  
  795. stock ircIsHalfOp(conn,channel[],user[])  
  796.  
  797. {  
  798.  
  799.         new ircLevel[3];  
  800.  
  801.         ircGetUserLevel(conn, channel, user, ircLevel);  
  802.  
  803.         if(!strcmp(ircLevel, "%", true,1)) return 1;  
  804.  
  805.         return 0;  
  806.  
  807. }  
  808.  
  809.  
  810.  
  811. stock ircHasVoice(conn,channel[],user[])  
  812.  
  813. {  
  814.  
  815.         new ircLevel[4];  
  816.  
  817.         ircGetUserLevel(conn, channel, user, ircLevel);  
  818.  
  819.         if(!strcmp(ircLevel, "+", true,1)) return 1;  
  820.  
  821.         return 0;  
  822.  
  823. }  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831. public ircOnUserSay(conn, channel[], user[], message[])  
  832.  
  833. {  
  834.  
  835.         if (channel[0] != '#') return 0;  
  836.  
  837.  
  838.  
  839.         if (message[0] != '!') return 1;                      // we only want messages starting with ~  
  840.  
  841.         new space = (strfind(message, " "));           // find the location of the space  
  842.  
  843.         new cmdlen;                                    // holds the length of the command  
  844.  
  845.  
  846.  
  847.         if (space>=1)                                  // do we have a space?  
  848.  
  849.         {  
  850.  
  851.                 new lenmsg = strlen(message);           // get the length of the entire message  
  852.  
  853.                 cmdlen = ((lenmsg-(lenmsg-space))-1);   // generate length of command  
  854.  
  855.         }  
  856.  
  857.         else  
  858.  
  859.         {  
  860.  
  861.                 cmdlen = (strlen(message)-1);         // generate the length of command  
  862.  
  863.         }  
  864.  
  865.         if (cmdlen == 3)                            // is our command 3 characters long?  
  866.  
  867.         {  
  868.  
  869.                 irccmd(say,3,conn,channel,user,message);  
  870.  
  871.                 irccmd(ban,3,conn,channel,user,message);  
  872.  
  873.                 irccmd(gmx,3,conn,channel,user,message);  
  874.  
  875.         }  
  876.  
  877.         else if (cmdlen == 4)                       //is our command 4 characters long?  
  878.  
  879.         {  
  880.  
  881.                 irccmd(mute,4,conn,channel,user,message);  
  882.  
  883.                 irccmd(join,4,conn,channel,user,message);  
  884.  
  885.                 irccmd(kick,4,conn,channel,user,message);  
  886.  
  887.                 //irccmd(warn,4,conn,channel,user,message);  
  888.  
  889.         }  
  890.  
  891.         else if (cmdlen == 5) // commands 5 chars  
  892.  
  893.         {  
  894.  
  895.                 irccmd(unban,5,conn,channel,user,message);  
  896.  
  897.         }  
  898.  
  899.         else if (cmdlen == 6) // commands 6 chars  
  900.  
  901.         {  
  902.  
  903.                 irccmd(unmute,6,conn,channel,user,message);  
  904.  
  905.         }  
  906.  
  907.         else if (cmdlen == 7)  
  908.  
  909.         {  
  910.  
  911.                 irccmd(unbanip,7,conn,channel,user,message);  
  912.  
  913.         }  
  914.  
  915.         return 1;  
  916.  
  917. }  
  918.  
  919. irccmd_warn(conn, channel[], user[], params[])  
  920.  
  921. {  
  922.  
  923.         if(!ircIsOp(conn,channel,user) && !ircIsHalfOp(conn,channel,user)) return false;  
  924.  
  925.         new playerName[25];  
  926.  
  927.         new strMsg[150];  
  928.  
  929.         new giveplayerid[25];  
  930.  
  931.  
  932.  
  933.         for(new a=0; a<=MAX_PLAYERS; a++)  
  934.  
  935.         {  
  936.  
  937.                 if(IsPlayerConnected(a))  
  938.  
  939.                 {  
  940.  
  941.                         GetPlayerName(a,playerName,16);  
  942.  
  943.                         giveplayerid = GetPlayerID(playerName,1);  
  944.  
  945.                         new space = (strfind(playerName, params));  
  946.  
  947.                         if(space != -1)  
  948.  
  949.                         {  
  950.  
  951.                                 format(strMsg, sizeof(strMsg), "**(ADMIN WARN)** \2;%s(%d)\2;", playerName,a);  
  952.  
  953.                                 SendClientMessageToAll(0xFF7F50AA, strMsg);  
  954.  
  955.                                 ircSay(conn,channel,strMsg);  
  956.  
  957.                                 new rpwarnings =0;  
  958.  
  959.                                 rpwarnings =dUserINT(playerName).("rpabusewar");  
  960.  
  961.                                 rpwarnings +=1;  
  962.  
  963.                                 if(rpwarnings >=3) {  
  964.  
  965.                                 SetPlayerInterior(giveplayerid,10);  
  966.  
  967.                                 SetPlayerPos(giveplayerid,219.6257,111.2549,999.0156);  
  968.  
  969.                                 SetPlayerFacingAngle(giveplayerid,2.2339);  
  970.  
  971.                                 SetCameraBehindPlayer(giveplayerid);  
  972.  
  973.                                 GetPlayerName(giveplayerid, string, 24);  
  974.  
  975.                                 format(string, 100, "**(AUTO KICK)** %s(%d) Too many admin warnings.",string,giveplayerid);  
  976.  
  977.                                 SendClientMessageToAll(0xFF7F50AA, string);  
  978.  
  979.                                 printf("%s", string);  
  980.  
  981.                                 dUserSetINT(PlayerName(giveplayerid)).("rpabusewar",0);  
  982.  
  983.                                 Kicking[giveplayerid] = 1;  
  984.  
  985.                                 SetTimer("KickPlayer",700,0);  
  986.  
  987.                                 }  
  988.  
  989.                                 else {  
  990.  
  991.                                         if(rpwarnings <=2) {  
  992.  
  993.                                         new output[255];  
  994.  
  995.                                         AdminKilled[giveplayerid] =1;s  
  996.  
  997.                                         SendClientMessageToAll(0xFF7F50AA, string);  
  998.  
  999.                                         SendClientMessage(giveplayerid,COLOR_RED,"YOU HAVE BEEN WARNED BY SERVER ADMIN.");  
  1000.  
  1001.                                         SendClientMessage(giveplayerid,COLOR_RED,"Further abuse will result in more warnings and possible a kick/ban");  
  1002.  
  1003.                                         SendClientMessage(giveplayerid,COLOR_RED,"Visit www.lvrcr.com for details or speak to a server admin");  
  1004.  
  1005.                                         dUserSetINT(PlayerName(giveplayerid)).("rpabusewar",rpwarnings);  
  1006.  
  1007.  
  1008.  
  1009.                                                 }  
  1010.  
  1011.                                                 }  
  1012.  
  1013.                                 return true;  
  1014.  
  1015.                         }  
  1016.  
  1017.                 }  
  1018.  
  1019.         }  
  1020.  
  1021.         format(strMsg, sizeof(strMsg), "2*** \2;%s\2; is not found on the server.", params);  
  1022.  
  1023.         ircSay(conn,channel,strMsg);  
  1024.  
  1025.         return true;  
  1026.  
  1027. }  
  1028.  
  1029.  
  1030.  
  1031. irccmd_unban(conn, channel[], user[], params[])  
  1032.  
  1033. {  
  1034.  
  1035.         if(!ircIsOp(conn,channel,user)) return false;  
  1036.  
  1037.         printinfo  
  1038.  
  1039.         dUserSetINT(params).("nameban",0);  
  1040.  
  1041.         new strMsg[150];  
  1042.  
  1043.         format(strMsg, sizeof(strMsg), "%s Unbanned.", params);  
  1044.  
  1045.         ircSay(conn,channel,strMsg);  
  1046.  
  1047.         return true;  
  1048.  
  1049. }  
  1050.  
  1051.  
  1052.  
  1053. irccmd_unbanip(conn, channel[], user[], params[])  
  1054.  
  1055. {  
  1056.  
  1057.         if(!ircIsOp(conn,channel,user)) return false;  
  1058.  
  1059.         printinfo  
  1060.  
  1061.         new strMsg[150];  
  1062.  
  1063.         new strMsg2[150];  
  1064.  
  1065.         format(strMsg2, sizeof(strMsg2), "PRIVMSG %s %s unbanned, %s.", user, params, user);  
  1066.  
  1067.     ircSendRawData(conn, strMsg2);  
  1068.  
  1069.         format(strMsg, sizeof(strMsg), "unbanip %s", params);  
  1070.  
  1071.         //ircSay(conn,channel,strMsg);  
  1072.  
  1073.         SendRconCommand(strMsg);  
  1074.  
  1075.         return true;  
  1076.  
  1077.  
  1078.  
  1079. }  
  1080.  
  1081. irccmd_gmx(conn, channel[], user[], params[])  
  1082.  
  1083. {  
  1084.  
  1085.         if(!ircIsOp(conn,channel,user)) return false;  
  1086.  
  1087.         printinfo  
  1088.  
  1089.         SendRconCommand("gmx");  
  1090.  
  1091.         return true;  
  1092.  
  1093. }  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101. irccmd_unmute(conn, channel[], user[], params[])  
  1102.  
  1103. {  
  1104.  
  1105.         if(!ircIsOp(conn,channel,user) && !ircIsHalfOp(conn,channel,user)) return false;  
  1106.  
  1107.         printinfo  
  1108.  
  1109.         new playerName[25];  
  1110.  
  1111.         new strMsg[150];  
  1112.  
  1113.         for(new a=0; a<=MAX_PLAYERS; a++)  
  1114.  
  1115.         {  
  1116.  
  1117.                 if(IsPlayerConnected(a))  
  1118.  
  1119.                 {  
  1120.  
  1121.                         GetPlayerName(a,playerName,16);  
  1122.  
  1123.                         new space = (strfind(playerName, params));  
  1124.  
  1125.                         if(space != -1)  
  1126.  
  1127.                         {  
  1128.  
  1129.                                 format(strMsg, sizeof(strMsg), "**(ADMIN UNMUTE)** \2;%s(%d)\2;", playerName,a);  
  1130.  
  1131.                                 SendClientMessageToAll(0xFF7F50AA, strMsg);  
  1132.  
  1133.                                 ircSay(conn,channel,strMsg);  
  1134.  
  1135. //                  Muted[a] =0;  
  1136.  
  1137.                                 return true;  
  1138.  
  1139.                         }  
  1140.  
  1141.                 }  
  1142.  
  1143.         }  
  1144.  
  1145.         format(strMsg, sizeof(strMsg), "2*** \2;%s\2; is not found on the server.", params);  
  1146.  
  1147.         ircSay(conn,channel,strMsg);  
  1148.  
  1149.         return true;  
  1150.  
  1151. }  
  1152.  
  1153.  
  1154.  
  1155. irccmd_mute(conn, channel[], user[], params[])  
  1156.  
  1157. {  
  1158.  
  1159.         if(!ircIsOp(conn,channel,user) && !ircIsHalfOp(conn,channel,user)) return false;  
  1160.  
  1161.         printinfo  
  1162.  
  1163.         new playerName[25];  
  1164.  
  1165.         new strMsg[150];  
  1166.  
  1167.         for(new a=0; a<=MAX_PLAYERS; a++)  
  1168.  
  1169.         {  
  1170.  
  1171.                 if(IsPlayerConnected(a))  
  1172.  
  1173.                 {  
  1174.  
  1175.                         GetPlayerName(a,playerName,16);  
  1176.  
  1177.                         new space = (strfind(playerName, params));  
  1178.  
  1179.                         if(space != -1)  
  1180.  
  1181.                         {  
  1182.  
  1183.                                 format(strMsg, sizeof(strMsg), "**(ADMIN MUTE)** \2;%s(%d)\2;", playerName,a);  
  1184.  
  1185.                                 SendClientMessageToAll(0xFF7F50AA, strMsg);  
  1186.  
  1187.                                 ircSay(conn,channel,strMsg);  
  1188.  
  1189. //                        Muted[a] =1;  
  1190.  
  1191.                                 return true;  
  1192.  
  1193.                         }  
  1194.  
  1195.                 }  
  1196.  
  1197.         }  
  1198.  
  1199.         format(strMsg, sizeof(strMsg), "2*** \2;%s\2; is not found on the server.", params);  
  1200.  
  1201.         ircSay(conn,channel,strMsg);  
  1202.  
  1203.         return true;  
  1204.  
  1205. }  
  1206.  
  1207.  
  1208.  
  1209. irccmd_say(conn, channel[], user[], params[])  
  1210.  
  1211. {  
  1212.  
  1213.     if (!ircIsOp(conn,channel,user) && !ircHasVoice(conn,channel,user) && !ircIsHalfOp(conn,channel,user)) return false;  
  1214.  
  1215.         printinfo  
  1216.  
  1217.         new msg[112];  
  1218.  
  1219.         format(msg,sizeof(msg), "%s(IRC) %s", user, params);  
  1220.  
  1221.         SendClientMessageToAll(0x2587CEAA, msg);  
  1222.  
  1223.         format(msg, sizeof(msg), "%s(IRC) %s", user, params);  
  1224.  
  1225.         ircSay(conn, channel, msg);  
  1226.  
  1227.         return true;  
  1228.  
  1229. }  
  1230.  
  1231.  
  1232.  
  1233. irccmd_join(conn,  channel[], user[],  params[])  
  1234.  
  1235. {  
  1236.  
  1237.     if (!ircIsOp(conn,channel,user)) return false;  
  1238.  
  1239.         printinfo  
  1240.  
  1241.         new strmessage[64];  
  1242.  
  1243.         format(strmessage, sizeof(strmessage), "2*** Joining channel \2;%s's\2;...", params);  
  1244.  
  1245.         ircSay(conn, channel, strmessage);  
  1246.  
  1247.         ircJoinChan(conn, params);  
  1248.  
  1249.         return true;  
  1250.  
  1251. }  
  1252.  
  1253.  
  1254.  
  1255. irccmd_kick(conn,  channel[], user[],  params[]) // supports kicking by partial nickname  
  1256.  
  1257. {  
  1258.  
  1259.         if (!ircIsOp(conn,channel,user) && !ircIsHalfOp(conn,channel,user)) return false;  
  1260.  
  1261.         printinfo  
  1262.  
  1263.         new strname[25];  
  1264.  
  1265.         new strmessage[150];  
  1266.  
  1267.         for (new a=0; a<=MAX_PLAYERS; a++)  
  1268.  
  1269.         {  
  1270.  
  1271.             if (IsPlayerConnected(a))  
  1272.  
  1273.             {  
  1274.  
  1275.                         GetPlayerName(a,strname,16);  
  1276.  
  1277.                         new space = (strfind(strname, params));  
  1278.  
  1279.                         if (space != -1)  
  1280.  
  1281.                         {  
  1282.  
  1283.  
  1284.  
  1285.                                 format(strmessage, sizeof(strmessage), "**(ADMIN KICK)** \2;%s(%d)\2;", strname,a);  
  1286.  
  1287.                                 SendClientMessageToAll(0xFF7F50AA, strmessage);  
  1288.  
  1289.                                 ircSay(conn,channel,strmessage);  
  1290.  
  1291. //                        Kicking[a] =1;  
  1292.  
  1293.                                 SetTimer("KickPlayer",700,0);  
  1294.  
  1295.                                 return true;  
  1296.  
  1297.                         }  
  1298.  
  1299.                 }  
  1300.  
  1301.         }  
  1302.  
  1303.         format(strmessage, sizeof(strmessage), "2*** \2;%s\2; is not found on the server.", params);  
  1304.  
  1305.         ircSay(conn,channel,strmessage);  
  1306.  
  1307.         return true;  
  1308.  
  1309. }  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315. irccmd_ban(conn,  channel[], user[],  params[]) // supports banning by partial nickname  
  1316.  
  1317. {  
  1318.  
  1319.         if (!ircIsOp(conn,channel,user)) return false;  
  1320.  
  1321.         printinfo  
  1322.  
  1323.         new strname[25];  
  1324.  
  1325.         new strmessage[150];  
  1326.  
  1327.         for (new a=0; a<=MAX_PLAYERS; a++)  
  1328.  
  1329.         {  
  1330.  
  1331.             if (IsPlayerConnected(a))  
  1332.  
  1333.             {  
  1334.  
  1335.                         GetPlayerName(a,strname,16);  
  1336.  
  1337.                         new space = (strfind(params, strname));  
  1338.  
  1339.                         if (space != -1)  
  1340.  
  1341.                         {  
  1342.  
  1343.  
  1344.  
  1345.                                 format(strmessage, sizeof(strmessage), "**(ADMIN BAN)** \2;%s(%d)\2;", strname,a);  
  1346.  
  1347.                                 SendClientMessageToAll(0xFF7F50AA, strmessage);  
  1348.  
  1349.                                 ircSay(conn,channel,strmessage);  
  1350.  
  1351. //          if(udb_Exists(PlayerName(a)) && PLAYERLIST_authed[a]) {  
  1352.  
  1353. //                        dUserSetINT(PlayerName(a)).("nameban",1);  
  1354.  
  1355. //                        }  
  1356.  
  1357. //                        Banning[a] = 1;  
  1358.  
  1359.   //                SetTimer("BanPlayer",700,0);  
  1360.  
  1361.                                 return true;  
  1362.  
  1363.                         }  
  1364.  
  1365.                 }  
  1366.  
  1367.         }  
  1368.  
  1369.         format(strmessage, sizeof(strmessage), "2*** \2;%s\2; is not found on the server.", params);  
  1370.  
  1371.         ircSay(conn,channel,strmessage);  
  1372.  
  1373.         return true;  
  1374.  

Submit a correction or amendment below. (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.