etPlayerTeamFromClass(playerid, classid) |
// This is a comment // uncomment the line below if you want to write a filterscript //#define FILTERSCRIPT #include <a_samp> #if defined FILTERSCRIPT #include <streamer> #include <sscanf2> #define COLOR_RED 0xFF0000AA #define SOA 1 #define LSPD 2 #define SOA_COLOUR 0x00820FAA #define LSPD_COLOUR 0x003DF5AA //kod som gцr sе att bara polis kan gе in i polisbil o soa bara kan gе i soa bike. enum TeamCars { Soa, Lspd } new Cars[TeamCars]; new gTeam[MAX_PLAYERS]; public OnFilterScriptInit() { print("\n--------------------------------------"); print(" Jimmy Karlsson"); print("--------------------------------------\n"); return 1; } public OnFilterScriptExit() { return 1; } #else main() { print("\n----------------------------------"); print(" JimmysDeathmatch"); print("----------------------------------\n"); } #endif public OnGameModeInit() { //Hдr lдgger man till nya skins. // Don't use these lines if it's a filterscript //SOA BIKES Cars[Soa] = CreateVehicle(463,694.8014,-474.0371,15.8537,90.5883,25,1); //Bikes Cars[Soa] = CreateVehicle(463,694.6365,-472.5578,15.8562,91.6353,32,1); //Bikes Cars[Soa] = CreateVehicle(463,694.5961,-470.9783,15.8557,88.3544,122,1); //Bikes Cars[Soa] = CreateVehicle(586,694.7456,-469.3488,15.8561,90.8062,10,1); //Bikes Cars[Soa] = CreateVehicle(586,694.7992,-467.5677,15.8553,87.6643,25,1); //Bikes //LSPD CAR Cars[Lspd] = CreateVehicle(597,1557.6084,-1607.4335,13.1503,3.6478,0,1); //LSPD Cruiser return 1; SetGameModeText("JimmysDeathmatch"); //SOA AddPlayerClass(247, 1545.7916,-1675.6432,13.5611,92.1874,0,0,0,0,0,0); AddPlayerClass(248,1545.7916,-1675.6432,13.5611,92.1874,0,0,0,0,0,0); //LSPD AddPlayerClass(280, 1545.7916,-1675.6432,13.5611,92.1874,0,0,0,0,0,0); AddPlayerClass(281,1545.7916,-1675.6432,13.5611,92.1874,0,0,0,0,0,0); return 1; } public OnGameModeExit() { return 1; } //Hдr har jag gjt sе att positionen дr vid polisstation //Camerapositionen tittar pе skinnens //Cameralookat tittar pе skinnens public OnPlayerRequestClass(playerid, classid) { SetPlayerTeamFromClass(playerid, classid); //gцr sе classen дndras till ett team! GivePlayerMoney(playerid, 15000); //han fеr 15000kr nдr han spawnar SetPlayerPos(playerid, 1483.5361,-1713.5564,14.0469); SetPlayerFacingAngle(playerid, 181.8816); SetPlayerCameraPos(playerid, 1483.4851,-1704.9474,14.0469); SetPlayerCameraLookAt(playerid, 1483.5361,-1713.5564,14.0469); return 1; } //Allt detta sker nдr nеgon connectar public OnPlayerConnect(playerid) { new string[256]; new playername[MAX_PLAYER_NAME]; GetPlayerName(playerid,playername,sizeof(playername));//denna koden sдger till scriptet att ta personen som connectars player name =) format(string, sizeof(string), "Welcome to the server %s fore tutorials and stuff visit http://random.com",playername); SendClientMessage(playerid,0xAA3333AA,string); //Stringen gцr sе det i stringen цver return 1; } public OnPlayerDisconnect(playerid, reason) { return 1; } public OnPlayerSpawn(playerid) { SetPlayerToTeamColor(playerid); //Nдr dom vдljer skin sе ska rдtt nametag o color vдljas det lцser den hдr. return 1; } public OnPlayerDeath(playerid, killerid, reason) { SendClientMessage(killerid,0xAA3333AA,"You murdered a man, and also stole his wallet with 500$ in it, hope no one saw you!");//Om du mцrdar nеgon fеr du detta meddelandet GivePlayerMoney(killerid, 500); //om man mцrdar nеgon fеr man 500$ (du rеnar han RP int ekommit sе lеngt дn ;) ) SendClientMessage(playerid,0xAA3333AA,"You were murdered and robbed for 500$, watch out next time!"); //om du blir mцrdad fеr du detta meddelandet GivePlayerMoney(playerid, -500);//om man dцr fцrlorar man 600 return 1; } public OnVehicleSpawn(vehicleid) { return 1; } public OnVehicleDeath(vehicleid, killerid) { return 1; } public OnPlayerText(playerid, text[]) { return 1; } //Hдr gцr jag kommands man kan anvдnda i spelet public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/kill", cmdtext, true, 10) == 0) { SetPlayerHealth(playerid, 0); return 1; } if (strcmp("/buymp5", cmdtext, true, 10) == 0) { GivePlayerWeapon(playerid, 29,200); GivePlayerMoney(playerid, -15000); //om du skriver /buymp5 sе "kцper" du en mp5 med 200 skott fцr 15000 return 1; } if (strcmp("/teleportspawn", cmdtext, true, 10) == 0) { SetPlayerPos(playerid, 1545.3984,-1675.6747,13.5603); //X, Y, Z return 1; } if (strcmp("/helpme", cmdtext, true, 10) == 0) { SendClientMessage(playerid,0xAA3333AA,"For all the commands/jobs/location etc go to http://random.com"); return 1; } if (strcmp("/teleport1", cmdtext, true, 10) == 0) { SetPlayerPos(playerid, 2442.7378,-1279.5771,24.0000); //X, Y, Z return 1; } //denna koden under gцr sе att jag kan spawna en bil, lite mera kompliserat if(strcmp("/admincar", cmdtext, true, 5) == 0){ new Float:x, Float:y, Float:z, Float:az; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, az); CreateVehicle(429, x+5, y+5, z, az, -1, -1, 180); return 1; } return 0; } public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { return 1; } public OnPlayerExitVehicle(playerid, vehicleid) { return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == 2) { new CarCheck = GetPlayerVehicleID(playerid); if(CarCheck == Cars[Soa] ) { if(gTeam[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, COLOR_RED, "You Don't have the keys for this car!"); return 1; } } if(CarCheck == Cars[Lspd] ) { if(gTeam[playerid] != 2) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, COLOR_RED, "You Don't have the keys for this car!"); return 1; } } return 1; } 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[]) { return 1; } public OnPlayerClickPlayer(playerid, clickedplayerid, source) { return 1; } SetPlayerTeamFromClass(playerid, classid) { if(classid == 0) { gTeam[playerid] = SOA; } if(classid == 1) { gTeam[playerid] = LSPD; } } SetPlayerToTeamColour(playerid) { if(gTeam[playerid] == SOA) { SetPlayerColor(playerid,SOA_COLOUR); //Green } if(gTeam[playerid] == LSPD) { SetPlayerColor(playerid,LSPD_COLOUR); // Blue } }
#define GroveStreet 1 #define TheBallas 2 #define LosSantonVagos 3 #define LosSantonPoliceDepartment 4 #define TheAdmins 5 enum TeamCars { Grove, Ballas, Vagos, Police, Admin } new Cars[TeamCars]; public OnGameModeInit() { SetGameModeText("Gang Wars 1.4 Pre-Release"); InsidePoliceInterior = CreatePickup(1559,1,246.9049,63.2743,1003.6406); OutsidePoliceInterior = CreatePickup(1559,1,1554.9202,-1675.6155,16.1953); InitAdminIsland(); InitNormalCars(); DisableInteriorEnterExits(); AddPlayerClass(105,2486.7302,-1646.1447,14.0703,178.8743,0,0,0,0,0,0); // Grove AddPlayerClass(106,2486.7302,-1646.1447,14.0703,178.8743,0,0,0,0,0,0); // Grove AddPlayerClass(107,2486.7302,-1646.1447,14.0703,178.8743,0,0,0,0,0,0); // Grove AddPlayerClass(102,2520.3413,-1269.8400,34.9172,92.3740,0,0,0,0,0,0); // Ballas AddPlayerClass(103,2520.1514,-1272.5846,34.8872,92.3014,0,0,0,0,0,0); // Ballas AddPlayerClass(104,2519.8794,-1275.8303,34.8543,91.9881,0,0,0,0,0,0); // Ballas AddPlayerClass(108,2091.1516,-1278.1311,26.1797,177.5771,0,0,0,0,0,0); // Vagos AddPlayerClass(109,2100.6931,-1321.1943,25.9531,0.3971,0,0,0,0,0,0); // Vagos AddPlayerClass(110,2126.6907,-1319.8890,26.6241,359.1438,0,0,0,0,0,0); // Vagos AddPlayerClass(280,238.0694,81.3392,1005.0391,177. 9750,0,0,0,0,0,0); // Police AddPlayerClass(284,254.0679,79.4351,1003.6406,184. 2418,0,0,0,0,0,0); // Police AddPlayerClass(285,251.9365,69.7897,1003.6406,182. 3534,0,0,0,0,0,0); // Police AddPlayerClass(0,-4710.60000976563, -2141.1999511719, 3,0,0,0,0,0,0,0); //Admin total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_airport.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_airport.txt"); total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_airport.txt"); Cars[Grove] = AddStaticVehicleEx(521,2504.1831,-1681.2936,13.4167,313.4581,16,16,200); // grove cars Cars[Grove] = AddStaticVehicleEx(567,2507.7161,-1676.5947,13.4150,328.0182,16,16,200); // grove cars Cars[Grove] = AddStaticVehicleEx(567,2509.7583,-1668.0225,13.4151,4.5082,16,16,200); // grove cars Cars[Grove] = AddStaticVehicleEx(492,2506.2393,-1661.5188,13.3711,30.4039,16,16,200); // grove cars Cars[Grove] = AddStaticVehicleEx(492,2499.9861,-1656.0059,13.3640,66.1636,16,16,200); // grove cars Cars[Grove] = AddStaticVehicleEx(492,2486.9788,-1655.2881,13.3001,89.6201,16,16,200); // grove cars Cars[Grove] = AddStaticVehicleEx(567,2477.8030,-1655.1450,13.2881,85.6544,16,16,200); // grove cars Cars[Grove] = AddStaticVehicleEx(521,2470.1208,-1669.4840,13.2762,194.7010,16,16,200); // grove cars Cars[Grove] = AddStaticVehicleEx(567,2482.7283,-1682.2708,13.2957,257.8247,16,16,200); // grove cars Cars[Grove] = AddStaticVehicleEx(521,2473.6814,-1691.4963,13.4823,355.3263,16,16,200); // grove cars Cars[Grove] = AddStaticVehicleEx(492,2492.7900,-1667.4320,13.3082,91.3398,16,16,200); // grove cars Cars[Grove] = AddStaticVehicleEx(492,-2482.1794,741.7360,34.9838,177.3357,16,16,200); // grove cars Cars[Ballas] = AddStaticVehicleEx(517,2517.2578,-1269.2622,34.6518,0.6344,18,18,200); // ballas cars Cars[Ballas] = AddStaticVehicleEx(412,2517.3618,-1279.1846,34.5842,1.0586,18,18,200); // ballas cars Cars[Ballas] = AddStaticVehicleEx(412,2517.5024,-1288.4667,34.5847,1.1375,18,18,200); // ballas cars Cars[Ballas] = AddStaticVehicleEx(517,2506.0754,-1268.5667,34.7061,357.3175,18,18,200); // ballas cars Cars[Ballas] = AddStaticVehicleEx(517,2506.1113,-1276.9868,34.5891,359.0419,18,18,200); // ballas cars Cars[Ballas] = AddStaticVehicleEx(521,2505.9934,-1285.8048,34.5832,358.9858,18,18,200); // ballas cars Cars[Ballas] = AddStaticVehicleEx(521,2505.7996,-1293.9130,34.6427,358.3488,18,18,200); // ballas cars Cars[Ballas] = AddStaticVehicleEx(517,2506.3281,-1303.9473,34.5854,0.5607,18,18,200); // ballas cars Cars[Ballas] = AddStaticVehicleEx(517,2497.6331,-1297.6099,33.6986,268.5708,18,18,200); // ballas cars Cars[Ballas] = AddStaticVehicleEx(412,2489.2539,-1297.4132,31.6066,268.6092,18,18,200); // ballas cars Cars[Ballas] = AddStaticVehicleEx(412,2516.9897,-1297.3716,34.5843,1.8464,18,18,200); // ballas cars Cars[Ballas] = AddStaticVehicleEx(517,2517.2505,-1306.3623,34.5850,1.9360,18,18,200); // ballas cars Cars[Ballas] = AddStaticVehicleEx(517,2497.3076,-1310.5127,34.6847,273.0965,18,18,200); // ballas cars Cars[Ballas] = AddStaticVehicleEx(517,2519.7905,-1251.0106,34.7905,87.8803,18,18,200); // ballas cars Cars[Ballas] = AddStaticVehicleEx(412,2512.1719,-1250.7924,34.7899,90.9067,18,18,200); // ballas cars Cars[Ballas] = AddStaticVehicleEx(412,2504.9294,-1243.6633,35.5174,179.7809,18,18,200); // ballas cars Cars[Ballas] = AddStaticVehicleEx(521,2496.9771,-1277.1754,33.5404,273.1626,18,18,200); // ballas cars Cars[Ballas] = AddStaticVehicleEx(521,2487.5352,-1276.9391,31.1641,270.3904,18,18,200); // ballas cars Cars[Vagos] = AddStaticVehicleEx(521,2136.9758,-1272.6902,25.2209,179.8333,6,6,200); // vagos cars Cars[Vagos] = AddStaticVehicleEx(521,2137.8257,-1282.0659,24.7039,180.3275,6,6,200); // vagos cars Cars[Vagos] = AddStaticVehicleEx(421,2137.8818,-1290.4994,23.8267,180.0450,6,6,200); // vagos cars Cars[Vagos] = AddStaticVehicleEx(521,2127.7202,-1295.4674,23.6272,88.8410,6,6,200); // vagos cars Cars[Vagos] = AddStaticVehicleEx(421,2146.4373,-1295.6436,23.6284,89.9669,6,6,200); // vagos cars Cars[Vagos] = AddStaticVehicleEx(467,2121.0525,-1295.1941,23.6236,89.8223,6,6,200); // vagos cars Cars[Vagos] = AddStaticVehicleEx(467,2113.0447,-1295.1909,23.6220,89.8825,6,6,200); // vagos cars Cars[Vagos] = AddStaticVehicleEx(467,2105.6450,-1295.1965,23.6220,89.8951,6,6,200); // vagos cars Cars[Vagos] = AddStaticVehicleEx(467,2102.6968,-1287.2336,24.1916,182.7039,6,6,200); // vagos cars Cars[Vagos] = AddStaticVehicleEx(421,2102.3328,-1279.4446,25.0922,182.6211,6,6,200); // vagos cars Cars[Vagos] = AddStaticVehicleEx(466,2102.0029,-1269.1632,25.2151,181.6679,6,6,200); // vagos cars Cars[Vagos] = AddStaticVehicleEx(466,2095.6672,-1278.7257,25.2222,180.8575,6,6,200); // vagos cars Cars[Vagos] = AddStaticVehicleEx(466,2095.6277,-1286.3131,24.4552,177.1500,6,6,200); // vagos cars Cars[Vagos] = AddStaticVehicleEx(466,2088.2161,-1295.3016,23.6221,90.7153,6,6,200); // vagos cars Cars[Vagos] = AddStaticVehicleEx(466,2096.1912,-1328.1865,25.2698,359.8462,6,6,200); // vagos cars Cars[Vagos] = AddStaticVehicleEx(421,2096.1262,-1320.2067,24.8310,0.5762,6,6,200); // vagos cars Cars[Vagos] = AddStaticVehicleEx(466,2096.1025,-1311.2137,23.8345,359.4650,6,6,200); // vagos cars Cars[Vagos] = AddStaticVehicleEx(466,2084.8406,-1306.4240,23.6298,87.8697,6,6,200); // vagos cars Cars[Vagos] = AddStaticVehicleEx(466,2102.6438,-1306.5737,23.6344,89.4859,6,6,200); // vagos cars Cars[Vagos] = AddStaticVehicleEx(412,2109.8848,-1306.2804,23.6363,90.0858,6,6,200); // vagos cars Cars[Vagos] = AddStaticVehicleEx(412,2120.9751,-1306.6559,23.6392,89.0898,6,6,200); // vagos cars Cars[Vagos] = AddStaticVehicleEx(412,2130.7627,-1306.5465,23.6423,88.5727,6,6,200); // vagos cars Cars[Vagos] = AddStaticVehicleEx(412,2135.9355,-1314.7562,24.1499,359.5461,6,6,200); // vagos cars Cars[Vagos] = AddStaticVehicleEx(412,2135.8562,-1324.9437,25.1730,359.5646,6,6,200); // vagos cars Cars[Vagos] = AddStaticVehicleEx(412,2141.0217,-1313.9171,24.0616,0.3629,6,6,200); // vagos cars Cars[Vagos] = AddStaticVehicleEx(412,2141.0828,-1323.4319,25.0907,0.3512,6,6,200); // vagos cars Cars[Vagos] = AddStaticVehicleEx(412,2151.7292,-1306.4357,23.6368,270.7486,6,6,200); // vagos cars Cars[Police] = AddStaticVehicleEx(523,1534.5154,-1644.3500,5.5969,359.9719,47,95,200); // police cars Cars[Police] = AddStaticVehicleEx(596,1530.4299,-1645.3601,5.5973,0.7343,47,95,200); // police cars Cars[Police] = AddStaticVehicleEx(523,1526.3368,-1644.7292,5.5976,1.6345,47,95,200); // police cars Cars[Police] = AddStaticVehicleEx(596,1545.0204,-1650.9500,5.5972,270.0413,47,95,200); // police cars Cars[Police] = AddStaticVehicleEx(596,1544.7876,-1654.8024,5.5970,270.1172,47,95,200); // police cars Cars[Police] = AddStaticVehicleEx(596,1544.9452,-1662.9974,5.5978,269.7078,47,95,200); // police cars Cars[Police] = AddStaticVehicleEx(596,1544.8580,-1667.9487,5.5970,269.5803,47,95,200); // police cars Cars[Police] = AddStaticVehicleEx(523,1544.4977,-1672.0206,5.5976,268.7257,47,95,200); // police cars Cars[Police] = AddStaticVehicleEx(596,1544.5427,-1676.1750,5.5973,270.9517,47,95,200); // police cars Cars[Police] = AddStaticVehicleEx(596,1544.4313,-1680.2073,5.5977,270.4905,47,95,200); // police cars Cars[Police] = AddStaticVehicleEx(523,1529.3984,-1688.1602,5.5969,89.5717,47,95,200); // police cars Cars[Police] = AddStaticVehicleEx(596,1558.9564,-1710.4376,5.5966,180.8348,47,95,200); // police cars Cars[Police] = AddStaticVehicleEx(596,1564.5616,-1710.0542,5.5969,181.2003,47,95,200); // police cars Cars[Police] = AddStaticVehicleEx(523,1570.3276,-1710.3354,5.5986,180.9288,47,95,200); // police cars Cars[Police] = AddStaticVehicleEx(596,1578.7135,-1710.6337,5.5974,180.9164,47,95,200); // police cars Cars[Police] = AddStaticVehicleEx(596,1583.5629,-1709.8947,5.5978,180.6574,47,95,200); // police cars Cars[Police] = AddStaticVehicleEx(596,1587.5587,-1709.7699,5.5972,180.8993,47,95,200); // police cars Cars[Police] = AddStaticVehicleEx(596,1591.5131,-1709.7134,5.5975,180.0194,47,95,200); // police cars Cars[Police] = AddStaticVehicleEx(523,1595.6508,-1709.6755,5.5975,180.7994,47,95,200); // police cars Cars[Police] = AddStaticVehicleEx(596,1601.0807,-1699.9777,5.5976,270.7956,47,95,200); // police cars Cars[Police] = AddStaticVehicleEx(596,1600.8729,-1691.9951,5.5977,269.0189,47,95,200); // police cars Cars[Police] = AddStaticVehicleEx(596,1600.3466,-1687.8993,5.5979,269.9349,47,95,200); // police cars Cars[Police] = AddStaticVehicleEx(523,1600.6891,-1683.9172,5.5974,269.9779,47,95,200); // police cars Cars[Police] = AddStaticVehicleEx(523,1585.9421,-1671.7094,5.6008,90.1356,47,95,200); // police cars Cars[Police] = AddStaticVehicleEx(596,1585.5795,-1667.5155,5.5992,90.0943,47,95,200); // police cars Cars[Police] = AddStaticVehicleEx(497,1565.3105,-1615.6497,13.0898,177.8273,47,95,200); // police helicopters Cars[Police] = AddStaticVehicleEx(497,1576.5695,-1614.2402,13.0899,179.9302,47,95,200); // police helicopters return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == 2) { new CarCheck = GetPlayerVehicleID(playerid); if(CarCheck == Cars[Grove]) { if(gTeam[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, RED, "You Don't have the keys for this car!"); return 1; } else { SendClientMessage(playerid, RED, "You have the keys for this car"); } } if(CarCheck == Cars[Ballas]) { if(gTeam[playerid] != 2) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, RED, "You Don't have the keys for this car!"); return 1; } else { SendClientMessage(playerid, RED, "You have the keys for this car"); } } if(CarCheck == Cars[Vagos]) { if(gTeam[playerid] != 3) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, RED, "You Don't have the keys for this car!"); return 1; } else { SendClientMessage(playerid, RED, "You have the keys for this car"); } } if(CarCheck == Cars[Police]) { if(gTeam[playerid] != 4) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, RED, "You Don't have the keys for this car!"); return 1; } else { SendClientMessage(playerid, RED, "You have the keys for this car"); } } return 1; } return 1; } |