Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //---------------------------------------|
- // |
- // |
- // |
- // Made by Drebin |
- // |
- // |
- // |
- //---------------------------------------|
- #include <a_samp>
- new PlayerText3D:pobLabel;
- new Float:pX, Float:pY, Float:pZ;
- new firstperson[MAX_PLAYERS];
- new pObject[MAX_PLAYERS];
- new selectedType[MAX_PLAYERS];
- new selectedModel[MAX_PLAYERS];
- new Text:TextdrawUp;
- new Text:TextdrawDown;
- new Text:TextdrawLeft;
- new Text:TextdrawRight;
- new Text:TextdrawFinish;
- new infotypes[] = {
- VEHICLE_MODEL_INFO_SIZE,
- VEHICLE_MODEL_INFO_FRONTSEAT,
- VEHICLE_MODEL_INFO_REARSEAT,
- VEHICLE_MODEL_INFO_PETROLCAP,
- VEHICLE_MODEL_INFO_WHEELSFRONT,
- VEHICLE_MODEL_INFO_WHEELSREAR,
- VEHICLE_MODEL_INFO_WHEELSMID,
- VEHICLE_MODEL_INFO_FRONT_BUMPER_Z,
- VEHICLE_MODEL_INFO_REAR_BUMPER_Z
- };
- new newObjectsNames[][] = {
- "badge01",
- "cane01",
- "monocle01",
- "moustache01",
- "moustache02",
- "tophat01",
- "wall001",
- "wall002",
- "wall003",
- "wall004",
- "wall005",
- "wall006",
- "wall007",
- "wall008",
- "wall009",
- "wall010",
- "wall011",
- "wall012",
- "wall013",
- "wall014",
- "wall015",
- "wall016",
- "wall017",
- "wall018",
- "wall019"
- };
- new newObjectsNames2[][] = {
- "wall020",
- "wall021",
- "wall022",
- "wall023",
- "wall024",
- "wall025",
- "wall026",
- "wall027",
- "wall028",
- "wall029",
- "wall030",
- "wall031",
- "wall032",
- "wall033",
- "wall034",
- "wall035",
- "wall036",
- "wall037",
- "wall038",
- "wall039",
- "wall040",
- "wall041",
- "wall042",
- "wall043",
- "wall044",
- "wall045",
- "wall046",
- "wall047",
- "wall048",
- "wall049",
- "wall050",
- "wall051",
- "wall052",
- "wall053",
- "wall054",
- "wall055",
- "wall056",
- "wall057",
- "wall058",
- "wall059",
- "wall060",
- "wall061",
- "wall062",
- "wall063",
- "wall064",
- "wall065",
- "handcuffs01",
- "police_lights01",
- "police_lights02",
- "headphones01",
- "headphones02",
- "headphones03",
- "headphones04",
- "speed_bump01"
- };
- new newObjectsNames3[][] = {
- "wall066",
- "wall067",
- "wall068",
- "wall069",
- "wall070",
- "wall071",
- "wall072",
- "wall073",
- "wall074",
- "wall075",
- "wall076",
- "wall077",
- "wall078",
- "wall079",
- "wall080",
- "wall081",
- "wall082",
- "wall083",
- "wall084",
- "wall085",
- "wall086",
- "wall087",
- "wall088",
- "wall089",
- "wall090",
- "wall091",
- "wall092",
- "wall093",
- "wall094",
- "wall095",
- "wall096",
- "wall097",
- "wall098",
- "wall099",
- "wall100",
- "wall101",
- "wall102",
- "wall103",
- "wall104",
- "wall105",
- "window001",
- "vehicle_barrier01",
- "bucket01",
- "scarf01"
- };
- new newObjectsNames4[][] = {
- "forsale01",
- "forsale02",
- "gasmask01",
- "grassplant01",
- "pokertable01"
- };
- new dIp[][] =
- {
- "{009BFF}/gotospawn\t\t{FFFFFF}To teleport back to the spawn",
- "{009BFF}/changelog\t\t{FFFFFF}To display the SA-MP 0.3e changelog",
- "\n{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}1{FFFFFF}",
- "{009BFF}/edit\t\t\t{FFFFFF}To modify the object near /gotospawn using the new EditObject();",
- "{009BFF}/selectobject\t\t{FFFFFF}To modify the object you are clicking on",
- "{009BFF}/dialogs\t\t{FFFFFF}To show all dialogs with the new caption",
- "{009BFF}/camera\t\t{FFFFFF}To try the new SetPlayerCameraLookAt(); movement",
- "{009BFF}/myversion\t\t{FFFFFF}To check out your SA-MP version",
- "{009BFF}/attachments\t\t{FFFFFF}To check out the new tool to modify holding objects [{009BFF}by h02{FFFFFF}]",
- "\n{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}2{FFFFFF}",
- "{009BFF}/movecamera\t\t{FFFFFF}To check out the new functions to move the player's camera",
- "{009BFF}/firstperson\t\t{FFFFFF}Enter first person camera view",
- "{009BFF}/exitfirstperson\t{FFFFFF}Exit first person camera view",
- "\n{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}4{FFFFFF}",
- "{009BFF}/flymode\t\t{FFFFFF}To try the flymode [{009BFF}by h02{FFFFFF}] (Also: {009BFF}/flymodehelp{FFFFFF})",
- "{009BFF}/flymodehelp\t\t{FFFFFF}Show the flymode help",
- "{009BFF}/selecttextdraw\t{FFFFFF}To check the new textdraw-clicking functions",
- "\n{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}6{FFFFFF}",
- "{009BFF}/vehicleinfo\t\t{FFFFFF}Get info about a certain vehicle model ID",
- "{009BFF}/changetexture\t{FFFFFF}Places a new texture on the editable object near the spawn",
- "\n\nThis gamemode has been scripted by {009BFF}Drebin"
- };
- new cLRC1[][] =
- {
- "{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}1{FFFFFF}\n",
- "{FFFFFF}• Fixed bug where a player could avoid death trough an animation applied",
- "{FFFFFF}• Fixed a bug not properly setting a player's colour when his ID was above 500",
- "{FFFFFF}• Fixed a bug where the player could be kicked through the usage of SpawnPlayer()",
- "{008000}+{FFFFFF} Added new custom objects [by {009BFF}cessil{FFFFFF}]",
- "{008000}+{FFFFFF} Added a new caption bar for all types of dialogs",
- "{008000}+{FFFFFF} Added a function to get the client's SA-MP version",
- "{008000}+{FFFFFF} Added a parameter to SetPlayerCameraLookAt() to apply a camera movement",
- "{008000}+{FFFFFF} Added a new tool to modify holding-, player- and global objects"
- };
- new cLRC2[][] =
- {
- "{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}2{FFFFFF}\n",
- "{FFFFFF}• Fixed bug where the player might be teleported to 0.0, 0.0, 0.0 after a vehicle they surfed on gets respawned",
- "{008000}+{FFFFFF} Added new functions to interpolate the player camera's position and look at",
- "{008000}+{FFFFFF} Added new functions to attach a player's camera to objects and playerobjects"
- };
- new cLRC3[][] =
- {
- "{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}3{FFFFFF}\n",
- "{FFFFFF}• Fixed problem where player attached objects might appear floating",
- "{FFFFFF}• Attached objects will now be removed when the player respawns or enters class selection",
- "{008000}+{FFFFFF} Added new custom objects [by {009BFF}cessil{FFFFFF}]"
- };
- new cLRC4[][] =
- {
- "{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}4{FFFFFF}\n",
- "{FFFFFF}• Fixed vehicle ID messup if a dead vehicle was deleted by the game",
- "{FFFFFF}• Player slots for the RC are now uncapped (up to 500 players)",
- "{FFFFFF}• Fixed texture filtering issue on the new models",
- "{008000}+{FFFFFF} Added noclip flymode camera example filterscript",
- "{008000}+{FFFFFF} Added new custom objects [by {009BFF}cessil{FFFFFF}]",
- "{008000}+{FFFFFF} Added functions to enable the player's mouse cursor to click on a TextDraw"
- };
- new cLRC5[][] =
- {
- "{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}5{FFFFFF}\n",
- "{FFFFFF}• Fixed a new bug introduced in 0.3e RC4 where sunk vehicles might get deleted by the client",
- "{FFFFFF}• Fixed a TextDraw still using hover colour after selection was disabled",
- "{FFFFFF}• Fixed two-sided texture problem with the bucket model",
- "{008000}+{FFFFFF} Added extra security to script callbacks",
- "{008000}+{FFFFFF} Added per-player TextDraw system"
- };
- new cLRC6[][] =
- {
- "{FFFFFF}• Fixed game crash if your vehicle is deleted while you're using the look behind camera",
- "{FFFFFF}• Local head movements are automatically disabled when using the attached object editor tool",
- "{FF0000}-{FFFFFF} Removed Pay'n'Spray map icons",
- "{008000}+{FFFFFF} Added GetVehicleModelInfo() pawn native for getting various information about vehicle models such as size etc",
- "{008000}+{FFFFFF} Added SetObjectMaterial() and SetPlayerObjectMaterial() so you can replace the texture on an object with a texture from another model in the game",
- "{008000}+{FFFFFF} Added new custom objects [by {009BFF}cessil{FFFFFF}]"
- };
- #define DIALOG_LIST 1
- #define DIALOG_MSGBOX 2
- #define DIALOG_PASSWORD 3
- #define DIALOG_INPUT 4
- #define DIALOG_HELP 5
- #define DIALOG_CHANGELOG_RC1 6
- #define DIALOG_CHANGELOG_RC2 7
- #define DIALOG_CHANGELOG_RC3 8
- #define DIALOG_CHANGELOG_RC4 9
- #define DIALOG_CHANGELOG_RC5 11
- #define DIALOG_CHANGELOG_RC6 12
- #define DIALOG_FLYMODEHELP 10
- #define DIALOG_INFOTYPE 13
- #define DIALOG_INFOVEHICLE 14
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Blank Filterscript by your name here");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n------------------------------------");
- print(" SA-MP 0.3e RC Test Script by Drebin");
- print("------------------------------------\n");
- }
- #endif
- public OnGameModeInit()
- {
- SetGameModeText("Test server");
- AddPlayerClass(0,1484.4316,-1709.5370,14.0469,180.0,0,0,0,0,0,0);
- new k = 0;
- new j = 0;
- new l = 0;
- new f = 0;
- new e = 0;
- new cc = 0;
- for(new i = 19347; i<= 19371; i++)
- {
- CreateObject(i, 1520.7598, -1718.5902 + (4 * k),14.0469, 0.0, 0.0, 0.0);
- new string[256];
- 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]);
- Create3DTextLabel(string,-1,1520.7598, -1718.5902 + (4 * k),13.0469,20.0,0,0);
- k++;
- }
- for(new m = 19372; m <= 19425; m++)
- {
- if((m >= 19375) && (m <= 19381))
- {
- CreateObject(m, 1421.5062, -1716.8317 + (10 * l), 16.5469, 0.0, 0.0, 0.0);
- new string[256];
- 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]);
- Create3DTextLabel(string,-1,1421.5062, -1716.8317 + (10 * l), 13.5469,20.0,0,0);
- l++;
- }
- }
- for(new n = 19372; n <= 19425; n++)
- {
- if((n <= 19374) || (n >= 19382))
- {
- CreateObject(n, 1403.6740 + (4 * j), -1739.2448, 14.0391, 0.0, 0.0, 90.0);
- new string[256];
- 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]);
- Create3DTextLabel(string,-1,1403.6740 + (4 * j), -1739.2448, 13.0391,20.0,0,0);
- j++;
- }
- }
- CreateObject(18750, 54.73, 1980.20, 50.88, 90.00, 0.00, 0.00);
- CreateVehicle(522, 1490.5847, -1717.3326, 13.5236, 180.0000, -1, -1, 100);
- CreateVehicle(522, 1492.5847, -1717.3326, 13.5236, 180.0000, -1, -1, 100);
- CreateVehicle(522, 1494.5847, -1717.3326, 13.5236, 180.0000, -1, -1, 100);
- CreateVehicle(522, 1496.5847, -1717.3326, 13.5236, 180.0000, -1, -1, 100);
- CreateVehicle(522, 1498.5847, -1717.3326, 13.5236, 180.0000, -1, -1, 100);
- CreateVehicle(522, 1500.5847, -1717.3326, 13.5236, 180.0000, -1, -1, 100);
- CreateVehicle(522, 1502.3832, -1717.3326, 13.5236, 180.0000, -1, -1, 100);
- TextdrawFinish = TextDrawCreate(314.000000, 306.000000, "ld_beat:cross");
- TextDrawAlignment(TextdrawFinish, 2);
- TextDrawBackgroundColor(TextdrawFinish, 255);
- TextDrawFont(TextdrawFinish, 4);
- TextDrawLetterSize(TextdrawFinish, 0.569998, 2.400000);
- TextDrawColor(TextdrawFinish, -1);
- TextDrawSetOutline(TextdrawFinish, 1);
- TextDrawSetProportional(TextdrawFinish, 1);
- TextDrawUseBox(TextdrawFinish, 1);
- TextDrawBoxColor(TextdrawFinish, 255);
- TextDrawTextSize(TextdrawFinish, 43.000000, 43.000000);
- TextdrawUp = TextDrawCreate(320.000000, 210.000000, "ld_beat:up");
- TextDrawBackgroundColor(TextdrawUp, 255);
- TextDrawFont(TextdrawUp, 4);
- TextDrawLetterSize(TextdrawUp, 0.500000, 1.000000);
- TextDrawColor(TextdrawUp, -1);
- TextDrawSetOutline(TextdrawUp, 0);
- TextDrawSetProportional(TextdrawUp, 1);
- TextDrawSetShadow(TextdrawUp, 1);
- TextDrawUseBox(TextdrawUp, 1);
- TextDrawBoxColor(TextdrawUp, 255);
- TextDrawTextSize(TextdrawUp, 31.000000, 31.000000);
- TextdrawDown = TextDrawCreate(320.000000, 270.000000, "ld_beat:down");
- TextDrawBackgroundColor(TextdrawDown, 255);
- TextDrawFont(TextdrawDown, 4);
- TextDrawLetterSize(TextdrawDown, 0.500000, 1.000000);
- TextDrawColor(TextdrawDown, -1);
- TextDrawSetOutline(TextdrawDown, 0);
- TextDrawSetProportional(TextdrawDown, 1);
- TextDrawSetShadow(TextdrawDown, 1);
- TextDrawUseBox(TextdrawDown, 1);
- TextDrawBoxColor(TextdrawDown, 255);
- TextDrawTextSize(TextdrawDown, 31.000000, 31.000000);
- TextdrawRight = TextDrawCreate(350.000000, 240.000000, "ld_beat:right");
- TextDrawBackgroundColor(TextdrawRight, 255);
- TextDrawFont(TextdrawRight, 4);
- TextDrawLetterSize(TextdrawRight, 0.500000, 1.000000);
- TextDrawColor(TextdrawRight, -1);
- TextDrawSetOutline(TextdrawRight, 0);
- TextDrawSetProportional(TextdrawRight, 1);
- TextDrawSetShadow(TextdrawRight, 1);
- TextDrawUseBox(TextdrawRight, 1);
- TextDrawBoxColor(TextdrawRight, 255);
- TextDrawTextSize(TextdrawRight, 31.000000, 31.000000);
- TextdrawLeft = TextDrawCreate(290.000000, 240.000000, "ld_beat:left");
- TextDrawBackgroundColor(TextdrawLeft, 255);
- TextDrawFont(TextdrawLeft, 4);
- TextDrawLetterSize(TextdrawLeft, 0.500000, 1.000000);
- TextDrawColor(TextdrawLeft, -1);
- TextDrawSetOutline(TextdrawLeft, 0);
- TextDrawSetProportional(TextdrawLeft, 1);
- TextDrawSetShadow(TextdrawLeft, 1);
- TextDrawUseBox(TextdrawLeft, 1);
- TextDrawBoxColor(TextdrawLeft, 255);
- TextDrawTextSize(TextdrawLeft, 31.000000, 31.000000);
- TextDrawSetSelectable(TextdrawUp,1);
- TextDrawSetSelectable(TextdrawDown,1);
- TextDrawSetSelectable(TextdrawLeft,1);
- TextDrawSetSelectable(TextdrawRight,1);
- TextDrawSetSelectable(TextdrawFinish,1);
- for(new g = 19426; g <= 19444; g++)
- {
- CreateObject(g, 1539.5983 + (2 * f), -1723.6078, 14.0391, 0.0, 0.0, 90.0);
- new string[256];
- 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]);
- Create3DTextLabel(string,-1,1539.5983 + (2 * f), -1723.6078, 14.0391,20.0,0,0);
- f++;
- }
- for(new h = 19445; h <= 19469; h++)
- {
- if(h == 19464 || h == 19465)
- {
- CreateObject(h, 1582.5935 + (10 * e), -1723.6078, 15.0391, 0.0, 0.0, 90.0);
- new string[256];
- 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]);
- Create3DTextLabel(string,-1,1582.5935 + (10 * e), -1723.6078, 15.0391,20.0,0,0);
- e++;
- }
- else if(h == 19467)
- {
- CreateObject(h, 1582.5935 + (10 * e), -1723.6078, 14.0391, 0.0, 180.0, 90.0);
- new string[256];
- 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]);
- Create3DTextLabel(string,-1,1582.5935 + (10 * e), -1723.6078, 14.0391,20.0,0,0);
- e++;
- }
- else
- {
- CreateObject(h, 1582.5935 + (10 * e), -1723.6078, 14.0391, 0.0, 0.0, 90.0);
- new string[256];
- 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]);
- Create3DTextLabel(string,-1,1582.5935 + (10 * e), -1723.6078, 14.0391,20.0,0,0);
- e++;
- }
- }
- for(new dd = 19470; dd<= 19474; dd++)
- {
- CreateObject(dd, 1448.9624, -1717.3468 + (3 * cc),14.0391, 0.0, 0.0, 0.0);
- new string[256];
- 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]);
- Create3DTextLabel(string,-1,1448.9624, -1717.3468 + (3 * cc),14.0391,20.0,0,0);
- cc++;
- }
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1484.7891,-1710.9650,14.0469);
- SetPlayerFacingAngle(playerid, -90.0);
- SetPlayerCameraPos(playerid, 1571.9016, -1575.8317, 49.1642);
- SetPlayerCameraLookAt(playerid, 1482.2811, -1664.9303, 13.6342);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- pObject[playerid] = CreatePlayerObject(playerid, 19364, 1474.0365,-1714.7456,14.5469, 0.0, 0.0, 90.0);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- 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);
- SendClientMessage(playerid,-1,"{FFFFFF}Welcome!");
- SendClientMessage(playerid,-1,"{FFFFFF}Check out {009BFF}/help {FFFFFF}to see all commands");
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new cmd[30];
- new idx;
- cmd = strtok(cmdtext, idx);
- if (strcmp("/dialogs", cmdtext, true, 10) == 0)
- {
- ShowPlayerDialog(playerid,DIALOG_LIST,DIALOG_STYLE_LIST,"Caption","Password Dialog\r\nInput Dialog\r\nMSGBOX Dialog","Select", "Close");
- return 1;
- }
- if (strcmp("/edit", cmdtext, true, 10) == 0)
- {
- EditPlayerObject(playerid,pObject[playerid]);
- SendClientMessage(playerid, -1, "{FFFFFF}Hint: Use {FFFF00}~k~~PED_SPRINT~{FFFFFF} to look around.");
- return 1;
- }
- if (strcmp("/selectobject", cmdtext, true, 10) == 0)
- {
- SelectObject(playerid);
- SendClientMessage(playerid,-1,"{FF0000}Note: {FFFFFF}Press ESC to cancel.");
- SendClientMessage(playerid, -1, "{FFFFFF}Hint: Use {FFFF00}~k~~PED_SPRINT~{FFFFFF} to look around.");
- return 1;
- }
- if (strcmp("/gotospawn", cmdtext, true, 10) == 0)
- {
- SetPlayerPos(playerid, 1484.7891,-1710.9650,14.0469);
- SetCameraBehindPlayer(playerid);
- return 1;
- }
- if (strcmp("/help", cmdtext, true, 10) == 0)
- {
- new string[2048];
- 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]);
- ShowPlayerDialog(playerid,DIALOG_HELP,DIALOG_STYLE_MSGBOX, "{FFFFFF}0.3{008000}e {FFFFFF}Test Server - Help",string,"Ok","");
- return 1;
- }
- if (strcmp("/myversion", cmdtext, true, 10) == 0)
- {
- new string[40];
- GetPlayerVersion(playerid, string, sizeof(string));
- format(string, sizeof(string), "Your version of SA-MP: %s", string);
- SendClientMessage(playerid, 0x009BFFFF, string);
- return 1;
- }
- if (strcmp("/camera", cmdtext, true, 10) == 0)
- {
- GetPlayerPos(playerid, pX, pY, pZ);
- SetPlayerCameraPos(playerid, 55.5887, 1864.8953, 52.5696);
- SetPlayerCameraLookAt(playerid, 55.5839, 1865.8995, 52.5346, 1);
- SendClientMessage(playerid,-1,"{FF0000}Note: {FFFFFF}Use {009BFF}/gotospawn {FFFFFF}to return to normal.");
- return 1;
- }
- if (strcmp("/movecamera", cmdtext, true, 10) == 0)
- {
- SetPlayerPos(playerid, 1695.7556, 386.9105, 20.4206);
- SetPlayerCameraPos(playerid, 1685.7556, 386.9105, 20.4206);
- SetPlayerCameraLookAt(playerid, 1257.1835, 364.7758, 1.1186);
- InterpolateCameraPos(playerid, 1685.7556, 386.9105, 20.4206, 1508.4935, 411.4099, 99.0430, 9000, 1);
- InterpolateCameraLookAt(playerid, 1257.1835, 364.7758, 1.1186, 1255.4568, 247.6968, 12.9874, 10000, 1);
- SendClientMessage(playerid,-1,"{FF0000}Note: {FFFFFF}Use {009BFF}/gotospawn {FFFFFF}to return to normal.");
- return 1;
- }
- if (strcmp("/firstperson", cmdtext, true, 10) == 0)
- {
- firstperson[playerid] = CreateObject(19300, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
- AttachObjectToPlayer(firstperson[playerid],playerid, 0.0, 0.12, 0.7, 0.0, 0.0, 0.0);
- AttachCameraToObject(playerid, firstperson[playerid]);
- SendClientMessage(playerid,-1,"{FF0000}Note: {FFFFFF}Use {009BFF}/exitfirstperson {FFFFFF}to return to normal.");
- return 1;
- }
- if (strcmp("/exitfirstperson", cmdtext, true, 10) == 0)
- {
- SetCameraBehindPlayer(playerid);
- DestroyObject(firstperson[playerid]);
- return 1;
- }
- if (strcmp("/changelog", cmdtext, true, 10) == 0)
- {
- new string[512];
- 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]);
- ShowPlayerDialog(playerid,DIALOG_CHANGELOG_RC5,DIALOG_STYLE_MSGBOX,"{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}5{FFFFFF} Changelog",string,"<- RC4","RC6 ->");
- return 1;
- }
- if (strcmp("/selecttextdraw", cmdtext, true, 10) == 0)
- {
- TextDrawShowForPlayer(playerid,TextdrawUp);
- TextDrawShowForPlayer(playerid,TextdrawDown);
- TextDrawShowForPlayer(playerid,TextdrawLeft);
- TextDrawShowForPlayer(playerid,TextdrawRight);
- TextDrawShowForPlayer(playerid,TextdrawFinish);
- SelectTextDraw(playerid, 0xFF0000FF);
- return 1;
- }
- if (strcmp("/flymodehelp", cmdtext, true, 10) == 0)
- {
- 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","");
- return 1;
- }
- if(strcmp(cmd, "/vehicleinfo", true) == 0)
- {
- 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");
- return 1;
- }
- if (strcmp("/changetexture", cmdtext, true, 10) == 0)
- {
- SetPlayerObjectMaterial(playerid, pObject[playerid], 0, 19341, "egg_texts", "easter_egg01", 0xFFFFFFFF);
- return 1;
- }
- return 0;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case 1:
- {
- if(!response)
- {
- SendClientMessage(playerid, 0xFF0000FF, "Dialog closed");
- return 1;
- }
- switch(listitem)
- {
- case 0:
- {
- ShowPlayerDialog(playerid, DIALOG_PASSWORD, DIALOG_STYLE_PASSWORD, "Example Caption","Example Info","Button1","Button2");
- }
- case 1:
- {
- ShowPlayerDialog(playerid, DIALOG_INPUT, DIALOG_STYLE_INPUT, "Example Caption","Example Info","Button1","Button2");
- }
- case 2:
- {
- ShowPlayerDialog(playerid, DIALOG_MSGBOX, DIALOG_STYLE_MSGBOX, "Example Caption","Example Info","Button1","Button2");
- }
- }
- }
- case DIALOG_CHANGELOG_RC6:
- {
- if(!response)
- {
- //close
- }
- else
- {
- new string[512];
- 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]);
- ShowPlayerDialog(playerid,DIALOG_CHANGELOG_RC5,DIALOG_STYLE_MSGBOX,"{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}5{FFFFFF} Changelog",string,"<- RC4","RC6 ->");
- }
- }
- case DIALOG_CHANGELOG_RC5:
- {
- if(!response)
- {
- new string[512];
- 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]);
- ShowPlayerDialog(playerid,DIALOG_CHANGELOG_RC6,DIALOG_STYLE_MSGBOX,"{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}6{FFFFFF} Changelog",string,"<- RC5","Close");
- }
- else
- {
- new string[512];
- 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]);
- ShowPlayerDialog(playerid,DIALOG_CHANGELOG_RC4,DIALOG_STYLE_MSGBOX,"{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}4{FFFFFF} Changelog",string,"<- RC3","RC5 ->");
- }
- }
- case DIALOG_CHANGELOG_RC4:
- {
- if(!response)
- {
- new string[512];
- 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]);
- ShowPlayerDialog(playerid,DIALOG_CHANGELOG_RC5,DIALOG_STYLE_MSGBOX,"{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}5{FFFFFF} Changelog",string,"<- RC4","RC6 ->");
- }
- else
- {
- new string[512];
- format(string,sizeof(string),"%s\n%s\n%s\n%s",cLRC3[0],cLRC3[1],cLRC3[2],cLRC3[3]);
- ShowPlayerDialog(playerid, DIALOG_CHANGELOG_RC3, DIALOG_STYLE_MSGBOX,"{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}3{FFFFFF} Changelog",string,"<- RC2","RC4 ->");
- }
- }
- case DIALOG_CHANGELOG_RC3:
- {
- if(!response)
- {
- new string[512];
- 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]);
- ShowPlayerDialog(playerid,DIALOG_CHANGELOG_RC4,DIALOG_STYLE_MSGBOX,"{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}4{FFFFFF} Changelog",string,"<- RC3","RC5 ->");
- }
- else
- {
- new string[512];
- format(string,sizeof(string),"%s\n%s\n%s\n%s",cLRC2[0],cLRC2[1],cLRC2[2],cLRC2[3]);
- ShowPlayerDialog(playerid, DIALOG_CHANGELOG_RC2,DIALOG_STYLE_MSGBOX,"{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}2{FFFFFF} Changelog",string,"<- RC1","RC3 ->");
- }
- }
- case DIALOG_CHANGELOG_RC2:
- {
- if(!response)
- {
- new string[512];
- format(string,sizeof(string),"%s\n%s\n%s\n%s",cLRC3[0],cLRC3[1],cLRC3[2],cLRC3[3]);
- ShowPlayerDialog(playerid, DIALOG_CHANGELOG_RC3, DIALOG_STYLE_MSGBOX,"{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}3{FFFFFF} Changelog",string,"<- RC2","RC4 ->");
- return 1;
- }
- else
- {
- new string[1024];
- 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]);
- ShowPlayerDialog(playerid, DIALOG_CHANGELOG_RC1, DIALOG_STYLE_MSGBOX,"{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}1{FFFFFF} Changelog",string,"Close","RC2 ->");
- }
- }
- case DIALOG_CHANGELOG_RC1:
- {
- if(!response)
- {
- new string[512];
- format(string,sizeof(string),"%s\n%s\n%s\n%s",cLRC2[0],cLRC2[1],cLRC2[2],cLRC2[3]);
- ShowPlayerDialog(playerid, DIALOG_CHANGELOG_RC2,DIALOG_STYLE_MSGBOX,"{FFFFFF}SA-MP 0.3{008000}e {FFFFFF}RC{008000}2{FFFFFF} Changelog",string,"<- RC1","RC3 ->");
- }
- }
- case DIALOG_INFOTYPE:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0: selectedType[playerid] = 0;
- case 1: selectedType[playerid] = 1;
- case 2: selectedType[playerid] = 2;
- case 3: selectedType[playerid] = 3;
- case 4: selectedType[playerid] = 4;
- case 5: selectedType[playerid] = 5;
- case 6: selectedType[playerid] = 6;
- case 7: selectedType[playerid] = 7;
- case 8: selectedType[playerid] = 8;
- }
- ShowPlayerDialog(playerid, DIALOG_INFOVEHICLE, DIALOG_STYLE_INPUT, "Model ID","Enter the ID of the model you want to have the info of","Ok","Cancel");
- }
- }
- case DIALOG_INFOVEHICLE:
- {
- if(response)
- {
- if(strlen(inputtext))
- {
- if(IsNumeric(inputtext))
- {
- if(strval(inputtext) >= 400 && strval(inputtext) <= 611)
- {
- selectedModel[playerid] = strval(inputtext);
- new string[256];
- new Float:X, Float:Y, Float:Z;
- GetVehicleModelInfo(selectedModel[playerid], infotypes[selectedType[playerid]], X, Y, Z);
- switch(selectedType[playerid])
- {
- case 0: format(string, sizeof(string), "Size of vehicle model {009BFF}%i{FFFFFF}: %.1f, %.1f, %.1f,", selectedModel[playerid], X, Y, Z);
- case 1: format(string, sizeof(string), "Position of the front seat of model {009BFF}%i{FFFFFF}: %.1f, %.1f, %.1f,", selectedModel[playerid], X, Y, Z);
- case 2: format(string, sizeof(string), "Position of the rear seat of model {009BFF}%i{FFFFFF}: %.1f, %.1f, %.1f,", selectedModel[playerid], X, Y, Z);
- case 3: format(string, sizeof(string), "Position of the petrol cap of model {009BFF}%i{FFFFFF}: %.1f, %.1f, %.1f,", selectedModel[playerid], X, Y, Z);
- case 4: format(string, sizeof(string), "Position of the front wheels of model {009BFF}%i{FFFFFF}: %.1f, %.1f, %.1f,", selectedModel[playerid], X, Y, Z);
- case 5: format(string, sizeof(string), "Position of the rear wheels of model {009BFF}%i{FFFFFF}: %.1f, %.1f, %.1f,", selectedModel[playerid], X, Y, Z);
- case 6: format(string, sizeof(string), "Position of the middle wheels of model {009BFF}%i{FFFFFF}: %.1f, %.1f, %.1f,", selectedModel[playerid], X, Y, Z);
- case 7: format(string, sizeof(string), "Heiht of the front bumper of model {009BFF}%i{FFFFFF}: %.1f, %.1f, %.1f,", selectedModel[playerid], X, Y, Z);
- case 8: format(string, sizeof(string), "Heiht of the rear bumper of model {009BFF}%i{FFFFFF}: %.1f, %.1f, %.1f,", selectedModel[playerid], X, Y, Z);
- }
- SendClientMessage(playerid, -1, string);
- 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).");
- }
- else
- {
- 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");
- }
- }
- else
- {
- 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");
- }
- }
- else
- {
- 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");
- }
- }
- }
- }
- return 0;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ)
- {
- if(response == EDIT_RESPONSE_FINAL)
- {
- DeletePlayer3DTextLabel(playerid, pobLabel);
- 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);
- }
- return 1;
- }
- public OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ)
- {
- if(type == SELECT_OBJECT_PLAYER_OBJECT)
- {
- EditPlayerObject(playerid, objectid);
- SendClientMessage(playerid,-1,"{FFFFFF}Object selected. You can now edit it.");
- }
- else SendClientMessage(playerid,-1,"{FF0000}ERROR: {FFFFFF}This is a global object, you are not allowed to edit it.");
- return 1;
- }
- public OnPlayerClickTextDraw(playerid, Text:clickedid)
- {
- if(clickedid == TextdrawUp)
- {
- GameTextForPlayer(playerid,"~w~You clicked ~y~up",3000,4);
- }
- else if(clickedid == TextdrawDown)
- {
- GameTextForPlayer(playerid,"~w~You clicked ~y~down",3000,4);
- }
- else if(clickedid == TextdrawLeft)
- {
- GameTextForPlayer(playerid,"~w~You clicked ~y~left",3000,4);
- }
- else if(clickedid == TextdrawRight)
- {
- GameTextForPlayer(playerid,"~w~You clicked ~y~right",3000,4);
- }
- else if(clickedid == TextdrawFinish)
- {
- GameTextForPlayer(playerid,"~w~You ~r~~h~finished!",3000,4);
- TextDrawHideForPlayer(playerid,TextdrawUp);
- TextDrawHideForPlayer(playerid,TextdrawDown);
- TextDrawHideForPlayer(playerid,TextdrawLeft);
- TextDrawHideForPlayer(playerid,TextdrawRight);
- TextDrawHideForPlayer(playerid,TextdrawFinish);
- CancelSelectTextDraw(playerid);
- }
- return 1;
- }
- strtok(const string[], &index)
- {
- new length = strlen(string);
- while ((index < length) && (string[index] <= ' '))
- {
- index++;
- }
- new offset = index;
- new result[20];
- while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
- {
- result[index - offset] = string[index];
- index++;
- }
- result[index - offset] = EOS;
- return result;
- }
- IsNumeric(szInput[]) {
- new iChar, i = 0;
- while ((iChar = szInput[i++])) if (!('0' <= iChar <= '9')) return 0;
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement