Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <float>
- #include <core>
- enum PlayerInfEnum {
- Float:X, Float:Y, Float:Z,
- Weapons[7], Ammos[7]
- };
- new PlayerInf[MAX_PLAYERS][PlayerInfEnum];
- new InGokart[MAX_PLAYERS], EndGokart[MAX_PLAYERS];
- public OnFilterScriptInit() {
- print("+----------------------------------+");
- print("| Gokart Track in SF |");
- print("| by |");
- print("| [HUN]Peti |");
- print("+----------------------------------+");
- for(new e=0; e<GetMaxPlayers(); e++) {
- InGokart[e] = false;
- EndGokart[e] = false;
- }
- CreateObject(978,-2091.372,-111.997,35.161,0.0,0.0,-179.623);
- CreateObject(978,-2082.217,-111.995,35.136,0.0,0.0,-179.623);
- CreateObject(978,-2072.840,-111.930,35.168,0.0,0.0,-179.623);
- CreateObject(978,-2063.583,-111.877,35.169,0.0,0.0,-179.623);
- CreateObject(978,-2055.661,-115.274,35.164,0.0,0.0,-226.892);
- CreateObject(978,-2037.446,-124.700,35.048,0.0,0.0,-281.036);
- CreateObject(978,-2052.354,-123.254,35.131,0.0,0.0,-267.285);
- CreateObject(978,-2055.398,-129.997,35.141,0.0,0.0,-320.570);
- CreateObject(978,-2041.377,-132.767,35.129,0.0,1.719,-310.257);
- CreateObject(978,-2048.537,-138.810,35.160,0.0,0.0,30.940);
- CreateObject(978,-2056.749,-142.105,35.168,0.0,0.0,12.892);
- CreateObject(978,-2065.794,-142.453,35.161,0.0,0.0,-10.313);
- CreateObject(978,-2063.587,-132.650,35.161,0.0,0.0,-364.401);
- CreateObject(978,-2072.439,-139.888,35.161,0.0,0.0,-33.518);
- CreateObject(978,-2076.562,-135.390,35.161,0.0,0.0,-61.879);
- CreateObject(978,-2078.187,-130.430,35.161,0.0,0.0,-85.944);
- CreateObject(978,-2075.871,-125.681,35.161,0.0,0.0,-143.526);
- CreateObject(978,-2071.988,-124.123,35.170,0.0,0.0,-179.623);
- CreateObject(978,-2071.745,-123.083,35.170,0.0,0.0,-191.655);
- CreateObject(978,-2079.101,-125.794,35.161,0.0,0.0,-123.759);
- CreateObject(978,-2081.563,-134.060,35.168,0.0,0.0,-90.241);
- CreateObject(1633,-2083.366,-142.824,35.371,0.0,0.0,182.201);
- CreateObject(1633,-2087.475,-142.980,35.371,0.0,0.0,182.201);
- CreateObject(1633,-2091.587,-143.217,35.396,0.0,0.0,182.201);
- CreateObject(978,-2094.894,-134.028,35.161,0.0,0.0,-76.490);
- CreateObject(3627,-2086.467,-166.469,32.710,0.0,0.0,1.719);
- CreateObject(976,-2078.362,-145.941,34.395,0.0,0.0,-88.522);
- CreateObject(976,-2078.141,-154.749,34.418,0.0,0.0,-88.522);
- CreateObject(976,-2077.910,-163.573,34.426,0.0,0.0,-88.522);
- CreateObject(976,-2077.621,-172.331,34.426,0.0,0.0,-88.522);
- CreateObject(976,-2077.534,-177.932,34.372,0.0,0.0,-88.522);
- CreateObject(1633,-2093.403,-190.122,35.346,0.0,0.0,0.963);
- CreateObject(1633,-2089.245,-190.078,35.346,0.0,0.0,0.963);
- CreateObject(1633,-2085.115,-189.998,35.346,0.0,0.0,0.963);
- CreateObject(976,-2081.616,-138.935,34.591,0.859,-14.610,-85.944);
- CreateObject(1633,-2080.971,-189.908,35.346,0.0,0.0,0.963);
- CreateObject(976,-2079.258,-186.751,36.636,0.859,18.048,-86.803);
- CreateObject(974,-2078.258,-183.654,38.498,0.0,0.0,72.193);
- CreateObject(978,-2078.708,-199.041,35.161,0.0,0.0,-270.723);
- CreateObject(978,-2094.329,-204.401,35.161,0.0,-0.859,-248.377);
- CreateObject(978,-2090.660,-209.721,35.161,0.0,-0.859,-219.156);
- CreateObject(978,-2083.501,-213.047,35.161,0.0,-0.859,-190.795);
- CreateObject(978,-2075.700,-200.305,35.161,0.0,-0.859,-133.212);
- CreateObject(978,-2075.575,-213.037,35.161,0.0,-0.859,-162.433);
- CreateObject(978,-2070.021,-209.227,34.936,0.0,-0.859,-134.931);
- CreateObject(978,-2070.137,-196.629,35.161,0.0,-0.859,-162.433);
- CreateObject(978,-2069.391,-210.065,35.161,0.0,-0.859,-305.099);
- CreateObject(978,-2063.047,-196.639,35.161,0.0,0.0,-205.405);
- CreateObject(978,-2057.245,-202.088,35.161,0.0,0.0,-242.361);
- CreateObject(978,-2055.740,-209.088,35.168,0.0,0.0,-281.035);
- CreateObject(978,-2058.790,-216.935,35.161,0.0,0.0,-302.521);
- CreateObject(978,-2064.429,-224.267,35.161,0.0,0.0,-312.834);
- CreateObject(978,-2074.453,-217.683,35.161,0.0,0.0,-302.521);
- CreateObject(974,-2071.483,-227.855,36.198,54.144,-91.100,-37.033);
- CreateObject(974,-2075.830,-224.491,36.123,54.144,-91.100,-37.033);
- CreateObject(974,-2075.138,-232.627,38.198,89.381,-90.241,-36.956);
- CreateObject(974,-2079.523,-229.220,38.148,89.381,-90.241,-36.956);
- CreateObject(974,-2078.819,-237.338,36.248,54.144,-91.100,143.449);
- CreateObject(974,-2083.174,-233.980,36.254,54.144,-91.100,143.449);
- CreateObject(978,-2077.376,-222.183,36.548,0.0,36.096,-307.678);
- CreateObject(978,-2081.980,-228.215,39.007,0.0,0.0,-306.818);
- CreateObject(978,-2085.435,-232.835,37.014,0.0,-31.799,-307.678);
- CreateObject(978,-2069.711,-229.794,37.326,0.0,34.377,-314.553);
- CreateObject(978,-2073.465,-234.348,39.045,0.0,0.0,-306.818);
- CreateObject(978,-2077.399,-239.084,36.803,0.0,-31.799,-307.678);
- CreateObject(978,-2077.417,-245.815,35.061,0.0,0.0,-234.626);
- CreateObject(978,-2088.527,-240.406,35.161,0.0,0.0,-276.738);
- CreateObject(978,-2087.927,-248.156,35.161,0.0,0.0,-255.253);
- CreateObject(978,-2085.056,-254.106,35.161,0.0,0.0,-233.767);
- CreateObject(978,-2080.540,-258.663,35.161,0.0,0.0,-214.859);
- CreateObject(978,-2073.681,-260.496,35.161,0.0,0.0,-173.606);
- CreateObject(978,-2067.781,-257.781,35.161,0.0,0.0,-131.493);
- CreateObject(978,-2065.214,-252.724,35.161,0.0,0.0,-100.553);
- CreateObject(978,-2075.187,-245.057,35.161,0.0,0.0,-263.847);
- CreateObject(978,-2063.605,-243.862,35.161,0.0,0.0,-100.553);
- CreateObject(978,-2064.527,-236.635,35.168,0.0,0.0,-57.582);
- CreateObject(978,-2070.123,-230.282,35.168,0.0,0.0,-40.393);
- CreateObject(978,-2079.047,-237.517,35.161,0.0,0.0,-220.875);
- CreateObject(978,-2074.497,-226.263,35.161,0.0,0.0,-29.220);
- CreateObject(978,-2084.471,-232.096,35.036,0.0,0.0,-52.425);
- CreateObject(978,-2077.972,-219.371,35.161,0.0,0.0,-96.256);
- CreateObject(974,-2083.966,-217.729,35.998,60.161,-91.100,-197.748);
- CreateObject(978,-2086.853,-224.002,35.161,0.0,0.0,-94.537);
- CreateObject(974,-2081.916,-211.891,37.608,89.381,-90.241,-18.908);
- CreateObject(974,-2077.565,-213.293,37.536,89.381,-90.241,-18.908);
- CreateObject(974,-2079.742,-205.665,37.526,89.381,-90.241,-18.908);
- CreateObject(974,-2075.475,-207.089,37.516,89.381,-90.241,-18.908);
- CreateObject(974,-2077.552,-199.349,37.433,89.381,-90.241,-18.908);
- CreateObject(974,-2073.296,-200.790,37.445,89.381,-90.241,-18.908);
- CreateObject(974,-2079.618,-219.202,35.923,60.161,-91.100,-197.748);
- CreateObject(974,-2079.541,-149.013,38.238,0.0,0.0,118.602);
- CreateObject(974,-2071.281,-194.956,35.776,60.161,-91.100,-18.126);
- CreateObject(974,-2075.760,-193.382,35.748,60.161,-91.100,-18.126);
- CreateObject(978,-2085.861,-217.109,36.611,0.0,28.361,-103.991);
- CreateObject(978,-2083.554,-209.499,38.413,0.0,-0.859,-110.007);
- CreateObject(978,-2080.524,-201.098,38.277,0.0,-0.859,-110.007);
- CreateObject(978,-2077.457,-220.200,36.598,0.0,28.361,-106.569);
- CreateObject(978,-2074.922,-212.141,38.362,0.0,-0.859,-108.288);
- CreateObject(978,-2072.033,-203.492,38.286,0.0,-0.859,-108.288);
- CreateObject(978,-2077.543,-193.228,36.411,0.0,28.361,69.615);
- CreateObject(978,-2068.975,-195.363,36.194,0.0,28.361,69.615);
- CreateObject(978,-2067.306,-187.367,35.011,0.0,-0.859,-96.256);
- CreateObject(978,-2066.593,-178.843,35.161,0.0,-0.859,-93.678);
- CreateObject(978,-2066.083,-170.518,35.161,0.0,-0.859,-93.678);
- CreateObject(978,-2061.079,-166.170,35.161,0.0,-0.859,-184.779);
- CreateObject(978,-2074.817,-157.992,35.161,0.0,-0.859,-132.353);
- CreateObject(978,-2068.927,-153.638,35.161,0.0,-0.859,-154.698);
- CreateObject(978,-2061.981,-151.532,35.161,0.0,-0.859,-171.887);
- CreateObject(978,-2056.564,-171.326,35.161,0.0,-0.859,-270.722);
- CreateObject(978,-2053.289,-152.010,35.161,0.0,-0.859,-194.233);
- CreateObject(978,-2047.068,-156.528,35.161,0.0,-0.859,-233.767);
- CreateObject(978,-2044.138,-163.394,35.161,0.0,-0.859,-261.269);
- CreateObject(978,-2043.669,-172.607,35.161,0.0,-0.859,-272.441);
- CreateObject(978,-2055.255,-180.122,35.161,0.0,-0.859,-251.815);
- CreateObject(978,-2051.451,-185.816,35.161,0.0,-0.859,-216.578);
- CreateObject(978,-2044.670,-188.072,35.161,0.0,-0.859,-181.341);
- CreateObject(978,-2038.011,-186.221,35.161,0.0,-0.859,-147.823);
- CreateObject(978,-2033.755,-179.347,35.161,0.0,-0.859,-92.818);
- CreateObject(978,-2033.337,-170.025,35.161,0.0,-0.859,-92.818);
- CreateObject(978,-2044.320,-156.188,35.161,0.0,-0.859,-92.818);
- CreateObject(978,-2041.955,-148.744,35.161,0.0,-0.859,-126.337);
- CreateObject(978,-2036.050,-144.768,35.161,0.0,-0.859,-164.152);
- CreateObject(978,-2028.224,-145.293,35.161,0.0,-0.859,-201.968);
- CreateObject(978,-2022.551,-150.093,35.161,0.0,-0.859,-238.064);
- CreateObject(978,-2019.954,-158.725,35.168,0.0,-0.859,-269.003);
- CreateObject(978,-2020.266,-168.259,35.161,0.0,-0.859,-274.160);
- CreateObject(978,-2020.991,-177.684,35.161,0.0,-0.859,-274.160);
- CreateObject(978,-2033.026,-164.382,35.161,0.0,-0.859,-92.818);
- CreateObject(978,-2022.240,-186.791,35.079,0.0,0.0,-281.035);
- CreateObject(978,-2025.286,-193.115,35.161,0.0,0.0,-308.537);
- CreateObject(978,-2030.959,-197.241,35.161,0.0,0.0,-342.914);
- CreateObject(978,-2037.759,-198.529,35.161,0.0,0.0,-355.806);
- CreateObject(978,-2044.315,-189.215,34.993,0.0,0.859,-348.930);
- CreateObject(978,-2050.774,-191.514,35.168,0.0,1.719,-322.288);
- CreateObject(978,-2053.469,-197.689,35.168,0.0,1.719,-264.706);
- CreateObject(978,-2050.594,-205.163,35.093,0.0,0.0,-235.486);
- CreateObject(978,-2045.048,-208.315,35.161,0.0,-0.859,-181.341);
- CreateObject(978,-2038.510,-208.516,35.161,0.0,0.859,-181.341);
- CreateObject(978,-2037.673,-198.835,35.136,0.0,-0.859,-178.763);
- CreateObject(978,-2028.630,-200.160,35.111,0.0,0.0,-192.514);
- CreateObject(978,-2024.028,-202.867,35.161,0.0,-0.859,-232.907);
- CreateObject(978,-2021.818,-209.497,35.161,0.0,0.0,82.506);
- CreateObject(978,-2024.967,-215.065,35.161,0.0,0.0,35.237);
- CreateObject(978,-2033.473,-217.882,35.161,0.0,0.0,0.0);
- CreateObject(978,-2038.328,-217.878,35.161,0.0,0.0,0.0);
- CreateObject(978,-2048.894,-209.544,35.161,0.0,0.0,13.751);
- CreateObject(978,-2053.016,-213.126,35.161,0.0,0.0,59.301);
- CreateObject(978,-2054.771,-220.285,35.168,0.0,0.0,87.662);
- CreateObject(978,-2043.036,-222.447,35.168,0.0,0.0,87.662);
- CreateObject(978,-2055.148,-229.586,35.161,0.0,0.0,87.662);
- CreateObject(978,-2055.498,-238.775,35.168,0.0,0.0,87.662);
- CreateObject(978,-2055.872,-247.992,35.168,0.0,0.0,87.662);
- CreateObject(978,-2043.406,-231.673,35.161,0.0,0.0,87.662);
- CreateObject(978,-2043.801,-240.982,35.161,0.0,0.0,87.662);
- CreateObject(978,-2044.217,-250.297,35.161,0.0,0.0,87.662);
- CreateObject(978,-2044.607,-259.602,35.161,0.0,0.0,87.662);
- CreateObject(978,-2056.266,-257.148,35.168,0.0,0.0,87.662);
- CreateObject(971,-2040.431,-264.217,37.790,0.0,0.0,0.0);
- CreateObject(971,-2036.125,-268.626,37.815,0.0,0.0,-91.100);
- CreateObject(971,-2056.632,-265.963,37.751,0.0,0.0,89.381);
- CreateObject(971,-2056.790,-274.788,37.672,0.0,0.0,89.381);
- CreateObject(971,-2036.140,-276.715,37.726,0.0,0.0,-91.100);
- CreateObject(1262,-2046.423,-122.048,39.093,0.0,0.0,0.0);
- CreateObject(1262,-2045.439,-122.036,39.091,0.0,0.0,0.0);
- CreateObject(1262,-2044.523,-122.011,39.074,0.0,0.0,0.0);
- return 1;
- }
- public OnFilterScriptExit() {
- for(new e=0; e<GetMaxPlayers(); e++) {
- InGokart[e] = false;
- EndGokart[e] = false;
- DisablePlayerRaceCheckpoint(e);
- }
- }
- public OnPlayerCommandText(playerid, cmdtext[]) {
- new idx, cmd[256];
- cmd = strtok(cmdtext, idx);
- if(!strcmp(cmd, "/gokart", true)) {
- if(InGokart[playerid]) {
- SendClientMessage(playerid, 0xFF0000AA, "You are already in the Gokart Track.");
- return 1;
- }
- GetPlayerPos(playerid, PlayerInf[playerid][X], PlayerInf[playerid][Y], PlayerInf[playerid][Z]);
- for(new i=0; i<7; i++) {
- GetPlayerWeaponData(playerid, i, PlayerInf[playerid][Weapons][i], PlayerInf[playerid][Ammos][i]);
- }
- ResetPlayerWeapons(playerid);
- SetPlayerPos(playerid, -2078.9170,-107.5986,35.3203);
- SetPlayerFacingAngle(playerid, 271.5153);
- InGokart[playerid] = true;
- SendClientMessage(playerid, 0xFFFF00AA, "Welcome to Gokart Track!");
- SetPlayerRaceCheckpoint(playerid, 2, -2050.4336, -273.2747, 35.3203, 0, 0, 0, 10);
- return 1;
- }
- if(!strcmp(cmd, "/exitkart", true)) {
- if(!InGokart[playerid]) {
- SendClientMessage(playerid, 0xFF0000AA, "You aren't in the Gokart Track.");
- return 1;
- }
- SetVehicleToRespawn(GetPlayerVehicleID(playerid));
- SetPlayerPos(playerid, PlayerInf[playerid][X], PlayerInf[playerid][Y], PlayerInf[playerid][Z]);
- for(new i=0; i<7; i++) {
- GivePlayerWeapon(playerid, PlayerInf[playerid][Weapons][i], PlayerInf[playerid][Ammos][i]);
- }
- DisablePlayerRaceCheckpoint(playerid);
- SendClientMessage(playerid, 0x11FF00AA, "Bye, bye!");
- InGokart[playerid] = false;
- EndGokart[playerid] = false;
- return 1;
- }
- return 0;
- }
- public OnPlayerEnterRaceCheckpoint(playerid) {
- if(InGokart[playerid]) {
- if (!EndGokart[playerid]) {
- GivePlayerMoney(playerid, 5000);
- EndGokart[playerid] = true;
- SendClientMessage(playerid, 0xFFFF00AA, "The end of the gokart track! Congratulation! Type /exitkart to go back to game, /again to repeat it.");
- DisablePlayerRaceCheckpoint(playerid);
- }
- }
- }
- public OnPlayerDeath(playerid) {
- if(InGokart[playerid]) {
- InGokart[playerid] = false;
- EndGokart[playerid] = false;
- PlayerInf[playerid][X] = 0;
- PlayerInf[playerid][Y] = 0;
- PlayerInf[playerid][Z] = 0;
- for(new i=0; i<7; i++) {
- PlayerInf[playerid][Weapons][i] = 0;
- PlayerInf[playerid][Ammos][i] = 0;
- }
- if (IsPlayerInAnyVehicle(playerid)) {
- SetVehicleToRespawn(GetPlayerVehicleID(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;
- }
- //-------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement