SHARE
TWEET

SA-MP 0.3e RC6 Test Script by Drebin

a guest Apr 5th, 2012 1,334 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //---------------------------------------|
  2. //                                       |
  3. //                                       |
  4. //                                       |
  5. //            Made by Drebin             |
  6. //                                       |
  7. //                                       |
  8. //                                       |
  9. //---------------------------------------|
  10.  
  11.  
  12. #include <a_samp>
  13.  
  14. new PlayerText3D:pobLabel;
  15. new Float:pX, Float:pY, Float:pZ;
  16. new firstperson[MAX_PLAYERS];
  17. new pObject[MAX_PLAYERS];
  18. new selectedType[MAX_PLAYERS];
  19. new selectedModel[MAX_PLAYERS];
  20. new Text:TextdrawUp;
  21. new Text:TextdrawDown;
  22. new Text:TextdrawLeft;
  23. new Text:TextdrawRight;
  24. new Text:TextdrawFinish;
  25.  
  26. new infotypes[] = {
  27.     VEHICLE_MODEL_INFO_SIZE,
  28.         VEHICLE_MODEL_INFO_FRONTSEAT,
  29.         VEHICLE_MODEL_INFO_REARSEAT,
  30.         VEHICLE_MODEL_INFO_PETROLCAP,
  31.         VEHICLE_MODEL_INFO_WHEELSFRONT,
  32.         VEHICLE_MODEL_INFO_WHEELSREAR,
  33.         VEHICLE_MODEL_INFO_WHEELSMID,
  34.         VEHICLE_MODEL_INFO_FRONT_BUMPER_Z,
  35.         VEHICLE_MODEL_INFO_REAR_BUMPER_Z
  36. };
  37.  
  38. new newObjectsNames[][] = {
  39.         "badge01",
  40.         "cane01",
  41.         "monocle01",
  42.         "moustache01",
  43.         "moustache02",
  44.         "tophat01",
  45.         "wall001",
  46.         "wall002",
  47.         "wall003",
  48.         "wall004",
  49.         "wall005",
  50.         "wall006",
  51.         "wall007",
  52.         "wall008",
  53.         "wall009",
  54.         "wall010",
  55.         "wall011",
  56.         "wall012",
  57.         "wall013",
  58.         "wall014",
  59.         "wall015",
  60.         "wall016",
  61.         "wall017",
  62.         "wall018",
  63.         "wall019"
  64. };
  65.  
  66. new newObjectsNames2[][] = {
  67.         "wall020",
  68.         "wall021",
  69.         "wall022",
  70.         "wall023",
  71.         "wall024",
  72.         "wall025",
  73.         "wall026",
  74.         "wall027",
  75.         "wall028",
  76.         "wall029",
  77.         "wall030",
  78.         "wall031",
  79.         "wall032",
  80.         "wall033",
  81.         "wall034",
  82.         "wall035",
  83.         "wall036",
  84.         "wall037",
  85.         "wall038",
  86.         "wall039",
  87.         "wall040",
  88.         "wall041",
  89.         "wall042",
  90.         "wall043",
  91.         "wall044",
  92.         "wall045",
  93.         "wall046",
  94.         "wall047",
  95.         "wall048",
  96.         "wall049",
  97.         "wall050",
  98.         "wall051",
  99.         "wall052",
  100.         "wall053",
  101.         "wall054",
  102.         "wall055",
  103.         "wall056",
  104.         "wall057",
  105.         "wall058",
  106.         "wall059",
  107.         "wall060",
  108.         "wall061",
  109.         "wall062",
  110.         "wall063",
  111.         "wall064",
  112.         "wall065",
  113.         "handcuffs01",
  114.         "police_lights01",
  115.         "police_lights02",
  116.         "headphones01",
  117.         "headphones02",
  118.         "headphones03",
  119.         "headphones04",
  120.         "speed_bump01"
  121. };
  122.  
  123. new newObjectsNames3[][] = {
  124.     "wall066",
  125.         "wall067",
  126.         "wall068",
  127.         "wall069",
  128.         "wall070",
  129.         "wall071",
  130.         "wall072",
  131.         "wall073",
  132.         "wall074",
  133.         "wall075",
  134.         "wall076",
  135.         "wall077",
  136.         "wall078",
  137.         "wall079",
  138.         "wall080",
  139.         "wall081",
  140.         "wall082",
  141.         "wall083",
  142.         "wall084",
  143.         "wall085",
  144.         "wall086",
  145.         "wall087",
  146.         "wall088",
  147.         "wall089",
  148.         "wall090",
  149.         "wall091",
  150.         "wall092",
  151.         "wall093",
  152.         "wall094",
  153.         "wall095",
  154.         "wall096",
  155.         "wall097",
  156.         "wall098",
  157.         "wall099",
  158.         "wall100",
  159.         "wall101",
  160.         "wall102",
  161.         "wall103",
  162.         "wall104",
  163.         "wall105",
  164.         "window001",
  165.         "vehicle_barrier01",
  166.         "bucket01",
  167.         "scarf01"
  168. };
  169.  
  170. new newObjectsNames4[][] = {
  171.     "forsale01",
  172.         "forsale02",
  173.         "gasmask01",
  174.         "grassplant01",
  175.         "pokertable01"
  176. };
  177.  
  178. new dIp[][] =
  179. {
  180.         "{009BFF}/gotospawn\t\t{FFFFFF}To teleport back to the spawn",
  181.         "{009BFF}/changelog\t\t{FFFFFF}To display the SA-MP 0.3e changelog",
  182.         "\n{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}1{FFFFFF}",
  183.         "{009BFF}/edit\t\t\t{FFFFFF}To modify the object near /gotospawn using the new EditObject();",
  184.         "{009BFF}/selectobject\t\t{FFFFFF}To modify the object you are clicking on",
  185.         "{009BFF}/dialogs\t\t{FFFFFF}To show all dialogs with the new caption",
  186.         "{009BFF}/camera\t\t{FFFFFF}To try the new SetPlayerCameraLookAt(); movement",
  187.         "{009BFF}/myversion\t\t{FFFFFF}To check out your SA-MP version",
  188.         "{009BFF}/attachments\t\t{FFFFFF}To check out the new tool to modify holding objects [{009BFF}by h02{FFFFFF}]",
  189.         "\n{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}2{FFFFFF}",
  190.         "{009BFF}/movecamera\t\t{FFFFFF}To check out the new functions to move the player's camera",
  191.         "{009BFF}/firstperson\t\t{FFFFFF}Enter first person camera view",
  192.         "{009BFF}/exitfirstperson\t{FFFFFF}Exit first person camera view",
  193.         "\n{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}4{FFFFFF}",
  194.         "{009BFF}/flymode\t\t{FFFFFF}To try the flymode [{009BFF}by h02{FFFFFF}] (Also: {009BFF}/flymodehelp{FFFFFF})",
  195.     "{009BFF}/flymodehelp\t\t{FFFFFF}Show the flymode help",
  196.         "{009BFF}/selecttextdraw\t{FFFFFF}To check the new textdraw-clicking functions",
  197.         "\n{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}6{FFFFFF}",
  198.         "{009BFF}/vehicleinfo\t\t{FFFFFF}Get info about a certain vehicle model ID",
  199.         "{009BFF}/changetexture\t{FFFFFF}Places a new texture on the editable object near the spawn",
  200.         "\n\nThis gamemode has been scripted by {009BFF}Drebin"
  201. };
  202.  
  203. new cLRC1[][] =
  204. {
  205.         "{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}1{FFFFFF}\n",
  206.         "{FFFFFF}• Fixed bug where a player could avoid death trough an animation applied",
  207.         "{FFFFFF}• Fixed a bug not properly setting a player's colour when his ID was above 500",
  208.         "{FFFFFF}• Fixed a bug where the player could be kicked through the usage of SpawnPlayer()",
  209.         "{008000}+{FFFFFF} Added new custom objects [by {009BFF}cessil{FFFFFF}]",
  210.         "{008000}+{FFFFFF} Added a new caption bar for all types of dialogs",
  211.         "{008000}+{FFFFFF} Added a function to get the client's SA-MP version",
  212.         "{008000}+{FFFFFF} Added a parameter to SetPlayerCameraLookAt() to apply a camera movement",
  213.         "{008000}+{FFFFFF} Added a new tool to modify holding-, player- and global objects"
  214. };
  215.  
  216. new cLRC2[][] =
  217. {
  218.         "{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}2{FFFFFF}\n",
  219.         "{FFFFFF}• Fixed bug where the player might be teleported to 0.0, 0.0, 0.0 after a vehicle they surfed on gets respawned",
  220.         "{008000}+{FFFFFF} Added new functions to interpolate the player camera's position and look at",
  221.         "{008000}+{FFFFFF} Added new functions to attach a player's camera to objects and playerobjects"
  222. };
  223.  
  224. new cLRC3[][] =
  225. {
  226.         "{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}3{FFFFFF}\n",
  227.         "{FFFFFF}• Fixed problem where player attached objects might appear floating",
  228.         "{FFFFFF}• Attached objects will now be removed when the player respawns or enters class selection",
  229.         "{008000}+{FFFFFF} Added new custom objects [by {009BFF}cessil{FFFFFF}]"
  230. };
  231.  
  232. new cLRC4[][] =
  233. {
  234.         "{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}4{FFFFFF}\n",
  235.         "{FFFFFF}• Fixed vehicle ID messup if a dead vehicle was deleted by the game",
  236.         "{FFFFFF}• Player slots for the RC are now uncapped (up to 500 players)",
  237.         "{FFFFFF}• Fixed texture filtering issue on the new models",
  238.         "{008000}+{FFFFFF} Added noclip flymode camera example filterscript",
  239.         "{008000}+{FFFFFF} Added new custom objects [by {009BFF}cessil{FFFFFF}]",
  240.         "{008000}+{FFFFFF} Added functions to enable the player's mouse cursor to click on a TextDraw"
  241. };
  242.  
  243. new cLRC5[][] =
  244. {
  245.         "{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}5{FFFFFF}\n",
  246.         "{FFFFFF}• Fixed a new bug introduced in 0.3e RC4 where sunk vehicles might get deleted by the client",
  247.         "{FFFFFF}• Fixed a TextDraw still using hover colour after selection was disabled",
  248.         "{FFFFFF}• Fixed two-sided texture problem with the bucket model",
  249.         "{008000}+{FFFFFF} Added extra security to script callbacks",
  250.         "{008000}+{FFFFFF} Added per-player TextDraw system"
  251. };
  252.  
  253. new cLRC6[][] =
  254. {
  255.         "{FFFFFF}• Fixed game crash if your vehicle is deleted while you're using the look behind camera",
  256.         "{FFFFFF}• Local head movements are automatically disabled when using the attached object editor tool",
  257.         "{FF0000}-{FFFFFF} Removed Pay'n'Spray map icons",
  258.         "{008000}+{FFFFFF} Added GetVehicleModelInfo() pawn native for getting various information about vehicle models such as size etc",
  259.         "{008000}+{FFFFFF} Added SetObjectMaterial() and SetPlayerObjectMaterial() so you can replace the texture on an object with a texture from another model in the game",
  260.         "{008000}+{FFFFFF} Added new custom objects [by {009BFF}cessil{FFFFFF}]"
  261. };
  262.  
  263. #define DIALOG_LIST 1
  264. #define DIALOG_MSGBOX 2
  265. #define DIALOG_PASSWORD 3
  266. #define DIALOG_INPUT 4
  267. #define DIALOG_HELP 5
  268. #define DIALOG_CHANGELOG_RC1 6
  269. #define DIALOG_CHANGELOG_RC2 7
  270. #define DIALOG_CHANGELOG_RC3 8
  271. #define DIALOG_CHANGELOG_RC4 9
  272. #define DIALOG_CHANGELOG_RC5 11
  273. #define DIALOG_CHANGELOG_RC6 12
  274. #define DIALOG_FLYMODEHELP 10
  275. #define DIALOG_INFOTYPE 13
  276. #define DIALOG_INFOVEHICLE 14
  277.  
  278. #if defined FILTERSCRIPT
  279.  
  280. public OnFilterScriptInit()
  281. {
  282.         print("\n--------------------------------------");
  283.         print(" Blank Filterscript by your name here");
  284.         print("--------------------------------------\n");
  285.         return 1;
  286. }
  287.  
  288. public OnFilterScriptExit()
  289. {
  290.         return 1;
  291. }
  292.  
  293. #else
  294.  
  295. main()
  296. {
  297.         print("\n------------------------------------");
  298.         print(" SA-MP 0.3e RC Test Script by Drebin");
  299.         print("------------------------------------\n");
  300. }
  301.  
  302. #endif
  303.  
  304. public OnGameModeInit()
  305. {
  306.         SetGameModeText("Test server");
  307.         AddPlayerClass(0,1484.4316,-1709.5370,14.0469,180.0,0,0,0,0,0,0);
  308.         new k = 0;
  309.         new j = 0;
  310.         new l = 0;
  311.         new f = 0;
  312.         new e = 0;
  313.         new cc = 0;
  314.         for(new i = 19347; i<= 19371; i++)
  315.         {
  316.                 CreateObject(i, 1520.7598, -1718.5902 + (4 * k),14.0469, 0.0, 0.0, 0.0);
  317.                 new string[256];
  318.                 format(string,128,"{009BFF}Model ID: {FFFFFF}%i\n{009BFF}Name: {FFFFFF}%s\n{009BFF}Added: {FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}1",i,newObjectsNames[k]);
  319.                 Create3DTextLabel(string,-1,1520.7598, -1718.5902 + (4 * k),13.0469,20.0,0,0);
  320.                 k++;
  321.         }
  322.         for(new m = 19372; m <= 19425; m++)
  323.         {
  324.             if((m >= 19375) && (m <= 19381))
  325.             {
  326.                 CreateObject(m, 1421.5062, -1716.8317 + (10 * l), 16.5469, 0.0, 0.0, 0.0);
  327.                         new string[256];
  328.                         format(string,256,"{009BFF}Model ID: {FFFFFF}%i\n{009BFF}Name: {FFFFFF}%s\n{009BFF}Added: {FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}3",m,newObjectsNames2[m-19372]);
  329.                         Create3DTextLabel(string,-1,1421.5062, -1716.8317 + (10 * l), 13.5469,20.0,0,0);
  330.                         l++;
  331.             }
  332.         }
  333.         for(new n = 19372; n <= 19425; n++)
  334.         {
  335.             if((n <= 19374) || (n >= 19382))
  336.             {
  337.                 CreateObject(n, 1403.6740 + (4 * j), -1739.2448, 14.0391, 0.0, 0.0, 90.0);
  338.                         new string[256];
  339.                         format(string,256,"{009BFF}Model ID: {FFFFFF}%i\n{009BFF}Name: {FFFFFF}%s\n{009BFF}Added: {FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}3",n,newObjectsNames2[n-19372]);
  340.                         Create3DTextLabel(string,-1,1403.6740 + (4 * j), -1739.2448, 13.0391,20.0,0,0);
  341.                         j++;
  342.                 }
  343.         }
  344.         CreateObject(18750, 54.73, 1980.20, 50.88,   90.00, 0.00, 0.00);
  345.         CreateVehicle(522, 1490.5847, -1717.3326, 13.5236, 180.0000, -1, -1, 100);
  346.         CreateVehicle(522, 1492.5847, -1717.3326, 13.5236, 180.0000, -1, -1, 100);
  347.         CreateVehicle(522, 1494.5847, -1717.3326, 13.5236, 180.0000, -1, -1, 100);
  348.         CreateVehicle(522, 1496.5847, -1717.3326, 13.5236, 180.0000, -1, -1, 100);
  349.         CreateVehicle(522, 1498.5847, -1717.3326, 13.5236, 180.0000, -1, -1, 100);
  350.         CreateVehicle(522, 1500.5847, -1717.3326, 13.5236, 180.0000, -1, -1, 100);
  351.         CreateVehicle(522, 1502.3832, -1717.3326, 13.5236, 180.0000, -1, -1, 100);
  352.        
  353.         TextdrawFinish = TextDrawCreate(314.000000, 306.000000, "ld_beat:cross");
  354.         TextDrawAlignment(TextdrawFinish, 2);
  355.         TextDrawBackgroundColor(TextdrawFinish, 255);
  356.         TextDrawFont(TextdrawFinish, 4);
  357.         TextDrawLetterSize(TextdrawFinish, 0.569998, 2.400000);
  358.         TextDrawColor(TextdrawFinish, -1);
  359.         TextDrawSetOutline(TextdrawFinish, 1);
  360.         TextDrawSetProportional(TextdrawFinish, 1);
  361.         TextDrawUseBox(TextdrawFinish, 1);
  362.         TextDrawBoxColor(TextdrawFinish, 255);
  363.         TextDrawTextSize(TextdrawFinish, 43.000000, 43.000000);
  364.  
  365.         TextdrawUp = TextDrawCreate(320.000000, 210.000000, "ld_beat:up");
  366.         TextDrawBackgroundColor(TextdrawUp, 255);
  367.         TextDrawFont(TextdrawUp, 4);
  368.         TextDrawLetterSize(TextdrawUp, 0.500000, 1.000000);
  369.         TextDrawColor(TextdrawUp, -1);
  370.         TextDrawSetOutline(TextdrawUp, 0);
  371.         TextDrawSetProportional(TextdrawUp, 1);
  372.         TextDrawSetShadow(TextdrawUp, 1);
  373.         TextDrawUseBox(TextdrawUp, 1);
  374.         TextDrawBoxColor(TextdrawUp, 255);
  375.         TextDrawTextSize(TextdrawUp, 31.000000, 31.000000);
  376.  
  377.         TextdrawDown = TextDrawCreate(320.000000, 270.000000, "ld_beat:down");
  378.         TextDrawBackgroundColor(TextdrawDown, 255);
  379.         TextDrawFont(TextdrawDown, 4);
  380.         TextDrawLetterSize(TextdrawDown, 0.500000, 1.000000);
  381.         TextDrawColor(TextdrawDown, -1);
  382.         TextDrawSetOutline(TextdrawDown, 0);
  383.         TextDrawSetProportional(TextdrawDown, 1);
  384.         TextDrawSetShadow(TextdrawDown, 1);
  385.         TextDrawUseBox(TextdrawDown, 1);
  386.         TextDrawBoxColor(TextdrawDown, 255);
  387.         TextDrawTextSize(TextdrawDown, 31.000000, 31.000000);
  388.  
  389.         TextdrawRight = TextDrawCreate(350.000000, 240.000000, "ld_beat:right");
  390.         TextDrawBackgroundColor(TextdrawRight, 255);
  391.         TextDrawFont(TextdrawRight, 4);
  392.         TextDrawLetterSize(TextdrawRight, 0.500000, 1.000000);
  393.         TextDrawColor(TextdrawRight, -1);
  394.         TextDrawSetOutline(TextdrawRight, 0);
  395.         TextDrawSetProportional(TextdrawRight, 1);
  396.         TextDrawSetShadow(TextdrawRight, 1);
  397.         TextDrawUseBox(TextdrawRight, 1);
  398.         TextDrawBoxColor(TextdrawRight, 255);
  399.         TextDrawTextSize(TextdrawRight, 31.000000, 31.000000);
  400.  
  401.         TextdrawLeft = TextDrawCreate(290.000000, 240.000000, "ld_beat:left");
  402.         TextDrawBackgroundColor(TextdrawLeft, 255);
  403.         TextDrawFont(TextdrawLeft, 4);
  404.         TextDrawLetterSize(TextdrawLeft, 0.500000, 1.000000);
  405.         TextDrawColor(TextdrawLeft, -1);
  406.         TextDrawSetOutline(TextdrawLeft, 0);
  407.         TextDrawSetProportional(TextdrawLeft, 1);
  408.         TextDrawSetShadow(TextdrawLeft, 1);
  409.         TextDrawUseBox(TextdrawLeft, 1);
  410.         TextDrawBoxColor(TextdrawLeft, 255);
  411.         TextDrawTextSize(TextdrawLeft, 31.000000, 31.000000);
  412.         TextDrawSetSelectable(TextdrawUp,1);
  413.         TextDrawSetSelectable(TextdrawDown,1);
  414.         TextDrawSetSelectable(TextdrawLeft,1);
  415.         TextDrawSetSelectable(TextdrawRight,1);
  416.         TextDrawSetSelectable(TextdrawFinish,1);
  417.         for(new g = 19426; g <= 19444; g++)
  418.         {
  419.             CreateObject(g, 1539.5983 + (2 * f), -1723.6078, 14.0391, 0.0, 0.0, 90.0);
  420.                 new string[256];
  421.                 format(string,256,"{009BFF}Model ID: {FFFFFF}%i\n{009BFF}Name: {FFFFFF}%s\n{009BFF}Added: {FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}4",g,newObjectsNames3[g-19426]);
  422.                 Create3DTextLabel(string,-1,1539.5983 + (2 * f), -1723.6078, 14.0391,20.0,0,0);
  423.                 f++;
  424.         }
  425.         for(new h = 19445; h <= 19469; h++)
  426.         {
  427.             if(h == 19464 || h == 19465)
  428.             {
  429.                 CreateObject(h, 1582.5935 + (10 * e), -1723.6078, 15.0391, 0.0, 0.0, 90.0);
  430.                         new string[256];
  431.                         format(string,256,"{009BFF}Model ID: {FFFFFF}%i\n{009BFF}Name: {FFFFFF}%s\n{009BFF}Added: {FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}4",h,newObjectsNames3[h-19426]);
  432.                         Create3DTextLabel(string,-1,1582.5935 + (10 * e), -1723.6078, 15.0391,20.0,0,0);
  433.                         e++;
  434.                 }
  435.                 else if(h == 19467)
  436.                 {
  437.                     CreateObject(h, 1582.5935 + (10 * e), -1723.6078, 14.0391, 0.0, 180.0, 90.0);
  438.                         new string[256];
  439.                         format(string,256,"{009BFF}Model ID: {FFFFFF}%i\n{009BFF}Name: {FFFFFF}%s\n{009BFF}Added: {FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}4",h,newObjectsNames3[h-19426]);
  440.                         Create3DTextLabel(string,-1,1582.5935 + (10 * e), -1723.6078, 14.0391,20.0,0,0);
  441.                         e++;
  442.                 }
  443.                 else
  444.                 {
  445.                     CreateObject(h, 1582.5935 + (10 * e), -1723.6078, 14.0391, 0.0, 0.0, 90.0);
  446.                         new string[256];
  447.                         format(string,256,"{009BFF}Model ID: {FFFFFF}%i\n{009BFF}Name: {FFFFFF}%s\n{009BFF}Added: {FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}4",h,newObjectsNames3[h-19426]);
  448.                         Create3DTextLabel(string,-1,1582.5935 + (10 * e), -1723.6078, 14.0391,20.0,0,0);
  449.                         e++;
  450.                 }
  451.         }
  452.         for(new dd = 19470; dd<= 19474; dd++)
  453.         {
  454.                 CreateObject(dd, 1448.9624, -1717.3468 + (3 * cc),14.0391, 0.0, 0.0, 0.0);
  455.                 new string[256];
  456.                 format(string,128,"{009BFF}Model ID: {FFFFFF}%i\n{009BFF}Name: {FFFFFF}%s\n{009BFF}Added: {FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}6",dd,newObjectsNames4[cc]);
  457.                 Create3DTextLabel(string,-1,1448.9624, -1717.3468 + (3 * cc),14.0391,20.0,0,0);
  458.                 cc++;
  459.         }
  460.         return 1;
  461. }
  462.  
  463. public OnGameModeExit()
  464. {
  465.         return 1;
  466. }
  467.  
  468. public OnPlayerRequestClass(playerid, classid)
  469. {
  470.     SetPlayerPos(playerid, 1484.7891,-1710.9650,14.0469);
  471.         SetPlayerFacingAngle(playerid, -90.0);
  472.         SetPlayerCameraPos(playerid, 1571.9016, -1575.8317, 49.1642);
  473.         SetPlayerCameraLookAt(playerid, 1482.2811, -1664.9303, 13.6342);
  474.         return 1;
  475. }
  476.  
  477. public OnPlayerConnect(playerid)
  478. {
  479.     pObject[playerid] = CreatePlayerObject(playerid, 19364, 1474.0365,-1714.7456,14.5469, 0.0, 0.0, 90.0);
  480.         return 1;
  481. }
  482.  
  483. public OnPlayerDisconnect(playerid, reason)
  484. {
  485.         return 1;
  486. }
  487.  
  488. public OnPlayerSpawn(playerid)
  489. {
  490.     pobLabel = CreatePlayer3DTextLabel(playerid, "{FFFFFF}Type {009BFF}/edit\n{FFFFFF}to modify me!\nOr use {009BFF}/selectobject\n{FFFFFF}and click me.",-1,1474.0365,-1714.7456,14.0469,30.0,INVALID_PLAYER_ID,INVALID_PLAYER_ID,0);
  491.         SendClientMessage(playerid,-1,"{FFFFFF}Welcome!");
  492.         SendClientMessage(playerid,-1,"{FFFFFF}Check out {009BFF}/help {FFFFFF}to see all commands");
  493.         return 1;
  494. }
  495.  
  496. public OnPlayerDeath(playerid, killerid, reason)
  497. {
  498.         return 1;
  499. }
  500.  
  501. public OnVehicleSpawn(vehicleid)
  502. {
  503.         return 1;
  504. }
  505.  
  506. public OnVehicleDeath(vehicleid, killerid)
  507. {
  508.         return 1;
  509. }
  510.  
  511. public OnPlayerText(playerid, text[])
  512. {
  513.         return 1;
  514. }
  515.  
  516. public OnPlayerCommandText(playerid, cmdtext[])
  517. {
  518.     new cmd[30];
  519.         new idx;
  520.         cmd = strtok(cmdtext, idx);
  521.         if (strcmp("/dialogs", cmdtext, true, 10) == 0)
  522.         {
  523.             ShowPlayerDialog(playerid,DIALOG_LIST,DIALOG_STYLE_LIST,"Caption","Password Dialog\r\nInput Dialog\r\nMSGBOX Dialog","Select", "Close");
  524.                 return 1;
  525.         }
  526.         if (strcmp("/edit", cmdtext, true, 10) == 0)
  527.         {
  528.             EditPlayerObject(playerid,pObject[playerid]);
  529.             SendClientMessage(playerid, -1, "{FFFFFF}Hint: Use {FFFF00}~k~~PED_SPRINT~{FFFFFF} to look around.");
  530.                 return 1;
  531.         }
  532.         if (strcmp("/selectobject", cmdtext, true, 10) == 0)
  533.         {
  534.             SelectObject(playerid);
  535.             SendClientMessage(playerid,-1,"{FF0000}Note: {FFFFFF}Press ESC to cancel.");
  536.             SendClientMessage(playerid, -1, "{FFFFFF}Hint: Use {FFFF00}~k~~PED_SPRINT~{FFFFFF} to look around.");
  537.                 return 1;
  538.         }
  539.         if (strcmp("/gotospawn", cmdtext, true, 10) == 0)
  540.         {
  541.             SetPlayerPos(playerid, 1484.7891,-1710.9650,14.0469);
  542.             SetCameraBehindPlayer(playerid);
  543.                 return 1;
  544.         }
  545.         if (strcmp("/help", cmdtext, true, 10) == 0)
  546.         {
  547.             new string[2048];
  548.             format(string,2048,"%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s",dIp[0],dIp[1],dIp[2],dIp[3],dIp[4],dIp[5],dIp[6],dIp[7],dIp[8],dIp[9],dIp[10],dIp[11],dIp[12],dIp[13],dIp[14],dIp[15],dIp[16],dIp[17],dIp[18],dIp[19],dIp[20]);
  549.             ShowPlayerDialog(playerid,DIALOG_HELP,DIALOG_STYLE_MSGBOX, "{FFFFFF}0.3{008000}e {FFFFFF}Test Server - Help",string,"Ok","");
  550.                 return 1;
  551.         }
  552.         if (strcmp("/myversion", cmdtext, true, 10) == 0)
  553.         {
  554.             new string[40];
  555.         GetPlayerVersion(playerid, string, sizeof(string));
  556.         format(string, sizeof(string), "Your version of SA-MP: %s", string);
  557.         SendClientMessage(playerid, 0x009BFFFF, string);
  558.                 return 1;
  559.         }
  560.         if (strcmp("/camera", cmdtext, true, 10) == 0)
  561.         {
  562.             GetPlayerPos(playerid, pX, pY, pZ);
  563.             SetPlayerCameraPos(playerid, 55.5887, 1864.8953, 52.5696);
  564.             SetPlayerCameraLookAt(playerid, 55.5839, 1865.8995, 52.5346, 1);
  565.                 SendClientMessage(playerid,-1,"{FF0000}Note: {FFFFFF}Use {009BFF}/gotospawn {FFFFFF}to return to normal.");
  566.                 return 1;
  567.         }
  568.         if (strcmp("/movecamera", cmdtext, true, 10) == 0)
  569.         {
  570.         SetPlayerPos(playerid, 1695.7556, 386.9105, 20.4206);
  571.                 SetPlayerCameraPos(playerid, 1685.7556, 386.9105, 20.4206);
  572.                 SetPlayerCameraLookAt(playerid, 1257.1835, 364.7758, 1.1186);
  573.                 InterpolateCameraPos(playerid, 1685.7556, 386.9105, 20.4206, 1508.4935, 411.4099, 99.0430, 9000, 1);
  574.                 InterpolateCameraLookAt(playerid, 1257.1835, 364.7758, 1.1186, 1255.4568, 247.6968, 12.9874, 10000, 1);
  575.                 SendClientMessage(playerid,-1,"{FF0000}Note: {FFFFFF}Use {009BFF}/gotospawn {FFFFFF}to return to normal.");
  576.                 return 1;
  577.         }
  578.         if (strcmp("/firstperson", cmdtext, true, 10) == 0)
  579.         {
  580.             firstperson[playerid] = CreateObject(19300, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
  581.         AttachObjectToPlayer(firstperson[playerid],playerid, 0.0, 0.12, 0.7, 0.0, 0.0, 0.0);
  582.             AttachCameraToObject(playerid, firstperson[playerid]);
  583.             SendClientMessage(playerid,-1,"{FF0000}Note: {FFFFFF}Use {009BFF}/exitfirstperson {FFFFFF}to return to normal.");
  584.                 return 1;
  585.         }
  586.         if (strcmp("/exitfirstperson", cmdtext, true, 10) == 0)
  587.         {
  588.             SetCameraBehindPlayer(playerid);
  589.         DestroyObject(firstperson[playerid]);
  590.                 return 1;
  591.         }
  592.         if (strcmp("/changelog", cmdtext, true, 10) == 0)
  593.         {
  594.         new string[512];
  595.                 format(string,sizeof(string),"%s\n%s\n%s\n%s\n%s\n%s",cLRC5[0],cLRC5[1],cLRC5[2],cLRC5[3],cLRC4[4],cLRC5[5]);
  596.                 ShowPlayerDialog(playerid,DIALOG_CHANGELOG_RC5,DIALOG_STYLE_MSGBOX,"{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}5{FFFFFF} Changelog",string,"<- RC4","RC6 ->");
  597.             return 1;
  598.         }
  599.         if (strcmp("/selecttextdraw", cmdtext, true, 10) == 0)
  600.         {
  601.             TextDrawShowForPlayer(playerid,TextdrawUp);
  602.             TextDrawShowForPlayer(playerid,TextdrawDown);
  603.             TextDrawShowForPlayer(playerid,TextdrawLeft);
  604.             TextDrawShowForPlayer(playerid,TextdrawRight);
  605.             TextDrawShowForPlayer(playerid,TextdrawFinish);
  606.             SelectTextDraw(playerid, 0xFF0000FF);
  607.             return 1;
  608.         }
  609.         if (strcmp("/flymodehelp", cmdtext, true, 10) == 0)
  610.         {
  611.             ShowPlayerDialog(playerid,DIALOG_FLYMODEHELP,DIALOG_STYLE_MSGBOX,"{FFFFFF}0.3{008000}e {FFFFFF}Test Server - Flymode","{009BFF}Arrow keys/WASD\t\t{FFFFFF}To fly arround\n{009BFF}/flymode\t\t{FFFFFF}Enter/Exit flymode","Ok","");
  612.             return 1;
  613.         }
  614.         if(strcmp(cmd, "/vehicleinfo", true) == 0)
  615.     {
  616.         ShowPlayerDialog(playerid, DIALOG_INFOTYPE, DIALOG_STYLE_LIST, "Vehicle info type","Vehicle size\nFront Seat Position\nRear Seat Position\nPetrol Cap Position\nFront Wheels Position\nRear Wheels Position\nMiddle Wheels Position (3 axes only)\nFront Bumper Heiht\nRear Bumper Heiht","Select","Cancel");
  617.             return 1;
  618.         }
  619.         if (strcmp("/changetexture", cmdtext, true, 10) == 0)
  620.         {
  621.             SetPlayerObjectMaterial(playerid, pObject[playerid], 0, 19341, "egg_texts", "easter_egg01", 0xFFFFFFFF);
  622.             return 1;
  623.         }
  624.         return 0;
  625. }
  626.  
  627. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  628. {
  629.         return 1;
  630. }
  631.  
  632. public OnPlayerExitVehicle(playerid, vehicleid)
  633. {
  634.         return 1;
  635. }
  636.  
  637. public OnPlayerStateChange(playerid, newstate, oldstate)
  638. {
  639.         return 1;
  640. }
  641.  
  642. public OnPlayerEnterCheckpoint(playerid)
  643. {
  644.         return 1;
  645. }
  646.  
  647. public OnPlayerLeaveCheckpoint(playerid)
  648. {
  649.         return 1;
  650. }
  651.  
  652. public OnPlayerEnterRaceCheckpoint(playerid)
  653. {
  654.         return 1;
  655. }
  656.  
  657. public OnPlayerLeaveRaceCheckpoint(playerid)
  658. {
  659.         return 1;
  660. }
  661.  
  662. public OnRconCommand(cmd[])
  663. {
  664.         return 1;
  665. }
  666.  
  667. public OnPlayerRequestSpawn(playerid)
  668. {
  669.         return 1;
  670. }
  671.  
  672. public OnObjectMoved(objectid)
  673. {
  674.         return 1;
  675. }
  676.  
  677. public OnPlayerObjectMoved(playerid, objectid)
  678. {
  679.         return 1;
  680. }
  681.  
  682. public OnPlayerPickUpPickup(playerid, pickupid)
  683. {
  684.         return 1;
  685. }
  686.  
  687. public OnVehicleMod(playerid, vehicleid, componentid)
  688. {
  689.         return 1;
  690. }
  691.  
  692. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  693. {
  694.         return 1;
  695. }
  696.  
  697. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  698. {
  699.         return 1;
  700. }
  701.  
  702. public OnPlayerSelectedMenuRow(playerid, row)
  703. {
  704.         return 1;
  705. }
  706.  
  707. public OnPlayerExitedMenu(playerid)
  708. {
  709.         return 1;
  710. }
  711.  
  712. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  713. {
  714.         return 1;
  715. }
  716.  
  717. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  718. {
  719.         return 1;
  720. }
  721.  
  722. public OnRconLoginAttempt(ip[], password[], success)
  723. {
  724.         return 1;
  725. }
  726.  
  727. public OnPlayerUpdate(playerid)
  728. {
  729.         return 1;
  730. }
  731.  
  732. public OnPlayerStreamIn(playerid, forplayerid)
  733. {
  734.         return 1;
  735. }
  736.  
  737. public OnPlayerStreamOut(playerid, forplayerid)
  738. {
  739.         return 1;
  740. }
  741.  
  742. public OnVehicleStreamIn(vehicleid, forplayerid)
  743. {
  744.         return 1;
  745. }
  746.  
  747. public OnVehicleStreamOut(vehicleid, forplayerid)
  748. {
  749.         return 1;
  750. }
  751.  
  752. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  753. {
  754.     switch(dialogid)
  755.     {
  756.         case 1:
  757.         {
  758.             if(!response)
  759.             {
  760.                 SendClientMessage(playerid, 0xFF0000FF, "Dialog closed");
  761.                 return 1;
  762.             }
  763.             switch(listitem)
  764.             {
  765.                 case 0:
  766.                 {
  767.                     ShowPlayerDialog(playerid, DIALOG_PASSWORD, DIALOG_STYLE_PASSWORD, "Example Caption","Example Info","Button1","Button2");
  768.                 }
  769.                 case 1:
  770.                 {
  771.                     ShowPlayerDialog(playerid, DIALOG_INPUT, DIALOG_STYLE_INPUT, "Example Caption","Example Info","Button1","Button2");
  772.                 }
  773.                 case 2:
  774.                 {
  775.                     ShowPlayerDialog(playerid, DIALOG_MSGBOX, DIALOG_STYLE_MSGBOX, "Example Caption","Example Info","Button1","Button2");
  776.                 }
  777.             }
  778.         }
  779.         case DIALOG_CHANGELOG_RC6:
  780.         {
  781.             if(!response)
  782.             {
  783.                                 //close
  784.             }
  785.             else
  786.             {
  787.                 new string[512];
  788.                                 format(string,sizeof(string),"%s\n%s\n%s\n%s\n%s\n%s",cLRC5[0],cLRC5[1],cLRC5[2],cLRC5[3],cLRC4[4],cLRC5[5]);
  789.                                 ShowPlayerDialog(playerid,DIALOG_CHANGELOG_RC5,DIALOG_STYLE_MSGBOX,"{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}5{FFFFFF} Changelog",string,"<- RC4","RC6 ->");
  790.             }
  791.         }
  792.         case DIALOG_CHANGELOG_RC5:
  793.         {
  794.             if(!response)
  795.             {
  796.                 new string[512];
  797.                                 format(string,sizeof(string),"%s\n%s\n%s\n%s\n%s\n%s",cLRC6[0],cLRC6[1],cLRC6[2],cLRC6[3],cLRC6[4],cLRC6[5]);
  798.                                 ShowPlayerDialog(playerid,DIALOG_CHANGELOG_RC6,DIALOG_STYLE_MSGBOX,"{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}6{FFFFFF} Changelog",string,"<- RC5","Close");
  799.             }
  800.             else
  801.             {
  802.                 new string[512];
  803.                                 format(string,sizeof(string),"%s\n%s\n%s\n%s\n%s\n%s\n%s\n",cLRC4[0],cLRC4[1],cLRC4[2],cLRC4[3],cLRC4[4],cLRC4[5],cLRC4[6]);
  804.                                 ShowPlayerDialog(playerid,DIALOG_CHANGELOG_RC4,DIALOG_STYLE_MSGBOX,"{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}4{FFFFFF} Changelog",string,"<- RC3","RC5 ->");
  805.             }
  806.         }
  807.         case DIALOG_CHANGELOG_RC4:
  808.         {
  809.                         if(!response)
  810.                         {
  811.                 new string[512];
  812.                                 format(string,sizeof(string),"%s\n%s\n%s\n%s\n%s\n%s",cLRC5[0],cLRC5[1],cLRC5[2],cLRC5[3],cLRC4[4],cLRC5[5]);
  813.                                 ShowPlayerDialog(playerid,DIALOG_CHANGELOG_RC5,DIALOG_STYLE_MSGBOX,"{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}5{FFFFFF} Changelog",string,"<- RC4","RC6 ->");
  814.                         }
  815.                         else
  816.                         {
  817.                             new string[512];
  818.                                 format(string,sizeof(string),"%s\n%s\n%s\n%s",cLRC3[0],cLRC3[1],cLRC3[2],cLRC3[3]);
  819.                 ShowPlayerDialog(playerid, DIALOG_CHANGELOG_RC3, DIALOG_STYLE_MSGBOX,"{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}3{FFFFFF} Changelog",string,"<- RC2","RC4 ->");
  820.                         }
  821.         }
  822.         case DIALOG_CHANGELOG_RC3:
  823.         {
  824.             if(!response)
  825.             {
  826.                                 new string[512];
  827.                                 format(string,sizeof(string),"%s\n%s\n%s\n%s\n%s\n%s\n%s\n",cLRC4[0],cLRC4[1],cLRC4[2],cLRC4[3],cLRC4[4],cLRC4[5],cLRC4[6]);
  828.                                 ShowPlayerDialog(playerid,DIALOG_CHANGELOG_RC4,DIALOG_STYLE_MSGBOX,"{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}4{FFFFFF} Changelog",string,"<- RC3","RC5 ->");
  829.             }
  830.             else
  831.             {
  832.                                 new string[512];
  833.                                 format(string,sizeof(string),"%s\n%s\n%s\n%s",cLRC2[0],cLRC2[1],cLRC2[2],cLRC2[3]);
  834.                 ShowPlayerDialog(playerid, DIALOG_CHANGELOG_RC2,DIALOG_STYLE_MSGBOX,"{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}2{FFFFFF} Changelog",string,"<- RC1","RC3 ->");
  835.             }
  836.         }
  837.         case DIALOG_CHANGELOG_RC2:
  838.         {
  839.             if(!response)
  840.             {
  841.                 new string[512];
  842.                                 format(string,sizeof(string),"%s\n%s\n%s\n%s",cLRC3[0],cLRC3[1],cLRC3[2],cLRC3[3]);
  843.                 ShowPlayerDialog(playerid, DIALOG_CHANGELOG_RC3, DIALOG_STYLE_MSGBOX,"{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}3{FFFFFF} Changelog",string,"<- RC2","RC4 ->");
  844.                                 return 1;
  845.                         }
  846.             else
  847.             {
  848.                 new string[1024];
  849.                         format(string,sizeof(string),"%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s",cLRC1[0],cLRC1[1],cLRC1[2],cLRC1[3],cLRC1[4],cLRC1[5],cLRC1[6],cLRC1[7],cLRC1[8]);
  850.                 ShowPlayerDialog(playerid, DIALOG_CHANGELOG_RC1, DIALOG_STYLE_MSGBOX,"{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}1{FFFFFF} Changelog",string,"Close","RC2 ->");
  851.             }
  852.                 }
  853.                 case DIALOG_CHANGELOG_RC1:
  854.                 {
  855.                 if(!response)
  856.                     {
  857.                         new string[512];
  858.                                 format(string,sizeof(string),"%s\n%s\n%s\n%s",cLRC2[0],cLRC2[1],cLRC2[2],cLRC2[3]);
  859.                         ShowPlayerDialog(playerid, DIALOG_CHANGELOG_RC2,DIALOG_STYLE_MSGBOX,"{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}2{FFFFFF} Changelog",string,"<- RC1","RC3 ->");
  860.                 }
  861.                 }
  862.                 case DIALOG_INFOTYPE:
  863.                 {
  864.                     if(response)
  865.                     {
  866.                         switch(listitem)
  867.                         {
  868.                             case 0: selectedType[playerid] = 0;
  869.                             case 1: selectedType[playerid] = 1;
  870.                             case 2: selectedType[playerid] = 2;
  871.                             case 3: selectedType[playerid] = 3;
  872.                             case 4: selectedType[playerid] = 4;
  873.                             case 5: selectedType[playerid] = 5;
  874.                             case 6: selectedType[playerid] = 6;
  875.                             case 7: selectedType[playerid] = 7;
  876.                             case 8: selectedType[playerid] = 8;
  877.                         }
  878.                         ShowPlayerDialog(playerid, DIALOG_INFOVEHICLE, DIALOG_STYLE_INPUT, "Model ID","Enter the ID of the model you want to have the info of","Ok","Cancel");
  879.                     }
  880.                 }
  881.                 case DIALOG_INFOVEHICLE:
  882.                 {
  883.                     if(response)
  884.                     {
  885.                         if(strlen(inputtext))
  886.                         {
  887.                             if(IsNumeric(inputtext))
  888.                             {
  889.                                 if(strval(inputtext) >= 400 && strval(inputtext) <= 611)
  890.                                 {
  891.                                     selectedModel[playerid] = strval(inputtext);
  892.                                     new string[256];
  893.                                     new Float:X, Float:Y, Float:Z;
  894.                                     GetVehicleModelInfo(selectedModel[playerid], infotypes[selectedType[playerid]], X, Y, Z);
  895.                                     switch(selectedType[playerid])
  896.                                     {
  897.                                         case 0: format(string, sizeof(string), "Size of vehicle model {009BFF}%i{FFFFFF}: %.1f, %.1f, %.1f,", selectedModel[playerid], X, Y, Z);
  898.                                 case 1: format(string, sizeof(string), "Position of the front seat of model {009BFF}%i{FFFFFF}: %.1f, %.1f, %.1f,", selectedModel[playerid], X, Y, Z);
  899.                                 case 2: format(string, sizeof(string), "Position of the rear seat of model {009BFF}%i{FFFFFF}: %.1f, %.1f, %.1f,", selectedModel[playerid], X, Y, Z);
  900.                                 case 3: format(string, sizeof(string), "Position of the petrol cap of model {009BFF}%i{FFFFFF}: %.1f, %.1f, %.1f,", selectedModel[playerid], X, Y, Z);
  901.                                 case 4: format(string, sizeof(string), "Position of the front wheels of model {009BFF}%i{FFFFFF}: %.1f, %.1f, %.1f,", selectedModel[playerid], X, Y, Z);
  902.                                 case 5: format(string, sizeof(string), "Position of the rear wheels of model {009BFF}%i{FFFFFF}: %.1f, %.1f, %.1f,", selectedModel[playerid], X, Y, Z);
  903.                                 case 6: format(string, sizeof(string), "Position of the middle wheels of model {009BFF}%i{FFFFFF}: %.1f, %.1f, %.1f,", selectedModel[playerid], X, Y, Z);
  904.                                 case 7: format(string, sizeof(string), "Heiht of the front bumper of model {009BFF}%i{FFFFFF}: %.1f, %.1f, %.1f,", selectedModel[playerid], X, Y, Z);
  905.                                 case 8: format(string, sizeof(string), "Heiht of the rear bumper of model {009BFF}%i{FFFFFF}: %.1f, %.1f, %.1f,", selectedModel[playerid], X, Y, Z);
  906.                                                         }
  907.                                                         SendClientMessage(playerid, -1, string);
  908.                                                         SendClientMessage(playerid, -1, "{FF0000}Note: {FFFFFF}If the values are 0.0, 0.0, 0.0, this model ID does not have this type of info in it (eg. no middle axle or no rear seat).");
  909.                                 }
  910.                                 else
  911.                                 {
  912.                                     ShowPlayerDialog(playerid, DIALOG_INFOVEHICLE, DIALOG_STYLE_INPUT, "Model ID","Enter the ID of the model you want to have the info of\nInvalid model ID. Choose an ID between 400 and 611.","Ok","Cancel");
  913.                                 }
  914.                             }
  915.                             else
  916.                             {
  917.                                 ShowPlayerDialog(playerid, DIALOG_INFOVEHICLE, DIALOG_STYLE_INPUT, "Model ID","Enter the ID of the model you want to have the info of\nYou may only enter numbers, no letters.","Ok","Cancel");
  918.                             }
  919.                         }
  920.                         else
  921.                         {
  922.                             ShowPlayerDialog(playerid, DIALOG_INFOVEHICLE, DIALOG_STYLE_INPUT, "Model ID","Enter the ID of the model you want to have the info of\nYou need to enter a number!","Ok","Cancel");
  923.                         }
  924.                     }
  925.                 }
  926.     }
  927.     return 0;
  928. }
  929.  
  930. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  931. {
  932.         return 1;
  933. }
  934.  
  935. public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ)
  936. {
  937.         if(response == EDIT_RESPONSE_FINAL)
  938.         {
  939.             DeletePlayer3DTextLabel(playerid, pobLabel);
  940.             pobLabel = CreatePlayer3DTextLabel(playerid, "{FFFFFF}Type {009BFF}/edit\n{FFFFFF}to modify me!\nOr use {009BFF}/selectobject\n{FFFFFF}and click me.",-1,fX,fY,fZ,30.0,INVALID_PLAYER_ID,INVALID_PLAYER_ID,0);
  941.         }
  942.         return 1;
  943. }
  944.  
  945. public OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ)
  946. {
  947.     if(type == SELECT_OBJECT_PLAYER_OBJECT)
  948.     {
  949.                 EditPlayerObject(playerid, objectid);
  950.                 SendClientMessage(playerid,-1,"{FFFFFF}Object selected. You can now edit it.");
  951.         }
  952.     else SendClientMessage(playerid,-1,"{FF0000}ERROR: {FFFFFF}This is a global object, you are not allowed to edit it.");
  953.         return 1;
  954. }
  955.  
  956. public OnPlayerClickTextDraw(playerid, Text:clickedid)
  957. {
  958.         if(clickedid == TextdrawUp)
  959.         {
  960.                 GameTextForPlayer(playerid,"~w~You clicked ~y~up",3000,4);
  961.         }
  962.         else if(clickedid == TextdrawDown)
  963.         {
  964.         GameTextForPlayer(playerid,"~w~You clicked ~y~down",3000,4);
  965.         }
  966.         else if(clickedid == TextdrawLeft)
  967.         {
  968.         GameTextForPlayer(playerid,"~w~You clicked ~y~left",3000,4);
  969.         }
  970.         else if(clickedid == TextdrawRight)
  971.         {
  972.         GameTextForPlayer(playerid,"~w~You clicked ~y~right",3000,4);
  973.         }
  974.         else if(clickedid == TextdrawFinish)
  975.         {
  976.                 GameTextForPlayer(playerid,"~w~You ~r~~h~finished!",3000,4);
  977.                 TextDrawHideForPlayer(playerid,TextdrawUp);
  978.                 TextDrawHideForPlayer(playerid,TextdrawDown);
  979.                 TextDrawHideForPlayer(playerid,TextdrawLeft);
  980.                 TextDrawHideForPlayer(playerid,TextdrawRight);
  981.                 TextDrawHideForPlayer(playerid,TextdrawFinish);
  982.         CancelSelectTextDraw(playerid);
  983.         }
  984.         return 1;
  985. }
  986.  
  987. strtok(const string[], &index)
  988. {
  989.         new length = strlen(string);
  990.         while ((index < length) && (string[index] <= ' '))
  991.         {
  992.                 index++;
  993.         }
  994.  
  995.         new offset = index;
  996.         new result[20];
  997.         while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  998.         {
  999.                 result[index - offset] = string[index];
  1000.                 index++;
  1001.         }
  1002.         result[index - offset] = EOS;
  1003.         return result;
  1004. }
  1005.  
  1006. IsNumeric(szInput[]) {
  1007.         new iChar, i = 0;
  1008.         while ((iChar = szInput[i++])) if (!('0' <= iChar <= '9')) return 0;
  1009.         return 1;
  1010. }
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