Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //////////////////////////////////
- // jServers - Sumo Test Include ////////////
- // Allows test of basic map functionality //
- // v1.2 - RDL ///////
- // For the love of fuck, do not edit this file //
- /////////////////////////////////////////////////
- #include <a_samp>
- #pragma tabsize 0
- #define SKIN_ID 101
- // WEATHERS
- #define SUNNY 18
- #define RAINY 8
- #define STORMY 8
- #define FOGGY 9
- #define SANDSTORM 19
- #define CLOUDY 15
- // Gamemode - there used to be others, but currently only 1
- #define NORMAL 1
- // variables
- new PlayerCount = 0;
- new UserVehicle;
- new ScriptInfo[];
- new AccountInfo[50][50];
- new Text3D:CSV[100];
- // colors, we only need two.
- #define COLOR_AQUA 0x0AB084FF
- #define COLOR_GREY 0xAFAFAFAA
- // define all the variables. Defaults entered are real world defaults for Sumo as of 3.7.0
- // These get changed by whats in your map, although not many of them are used in this test anyway.
- new Float:Z_FALLOFF = 0.0;
- new GAME_MODE_TYPE = 1;
- new WIN_TIME = 400;
- new MapTime = 12;
- new Weather = 2;
- new RED_IDENTIFY_TYPE = 1;
- new RESPAWN_DELAY = 15;
- new MAP_TIMEOUT = 2250;
- new GIVE_NITRO = 0;
- new RANDOM_MODDED_VEHICLES = 1;
- new MOD_ALL_VEHICLES = 0;
- new ELIMINATE_FLIP = 0;
- new FLIP_FLIPPED = 0;
- new ENABLE_NOT_MOVE_LOSE = 0;
- new NOT_MOVE_WARNINGS = 3;
- new ENABLE_REPAIR = 0;
- new REPAIR_INTERVAL = 60;
- new REPAIR_AMOUNT = 160;
- new REPAIR_X = 125;
- new MAX_ALLOWED_HEALTH = 2500;
- new ENABLE_FIRE_TRUCK_RESCUE = 1;
- new LIMIT_TOTAL_DUMPERS = 1;
- new ALLOW_RAMP_SPAWNING = 0;
- new LIMIT_TOTAL_HARVESTERS = 2;
- new LIMIT_TOTAL_DOZERS = 1;
- new LIMIT_TOTAL_BIKES = 3;
- new Float:MAX_Z = -0.1;
- new MAP_INCLUDES_WEAPONS = 0;
- new MAP_USES_SPEED_ALTERATION = 0;
- new AC_DISABLE_HEALTH_DETECTION = 0;
- new MAX_SPEED_ALLOWED = 125;
- new DISABLE_Z_DETECTION = 0;
- new ALLOW_EARLY_FINISH = 1;
- new DISABLE_BC5_CHECK = 1;
- new DISABLE_ACHIEVEMENTS = 0;
- new FORCE_DUEL_CAR = 0;
- new FIRE_TRUCK_RESCUE_AMT = 500;
- new SUDDEN_DEATH = 0;
- new LIMIT_TOTAL_SWAT = 1;
- new FORCE_RED_INVOLVEMENT = 0;
- new Float:FRI_DISTANCE = 50.0;
- // We don't use most of the above. So just tell the PAWN compiler this, else it'll shit out lots of warnings.
- #pragma unused LIMIT_TOTAL_BIKES, LIMIT_TOTAL_HARVESTERS
- #pragma unused LIMIT_TOTAL_DOZERS, LIMIT_TOTAL_DUMPERS, ENABLE_FIRE_TRUCK_RESCUE, REPAIR_AMOUNT, REPAIR_INTERVAL, ENABLE_REPAIR, NOT_MOVE_WARNINGS, ENABLE_NOT_MOVE_LOSE
- #pragma unused FLIP_FLIPPED, ELIMINATE_FLIP, MOD_ALL_VEHICLES, RANDOM_MODDED_VEHICLES, GIVE_NITRO, MAP_TIMEOUT, RESPAWN_DELAY
- #pragma unused RED_IDENTIFY_TYPE, WIN_TIME, GAME_MODE_TYPE, MAX_ALLOWED_HEALTH, ScriptInfo, PlayerCount
- #pragma unused DISABLE_BC5_CHECK, ALLOW_EARLY_FINISH, MAX_SPEED_ALLOWED, AC_DISABLE_HEALTH_DETECTION, LIMIT_TOTAL_SWAT
- #pragma unused MAP_INCLUDES_WEAPONS, MAP_USES_SPEED_ALTERATION, DISABLE_Z_DETECTION
- #pragma unused MAX_Z, FORCE_DUEL_CAR, DISABLE_ACHIEVEMENTS, FIRE_TRUCK_RESCUE_AMT, SUDDEN_DEATH
- // Define some dud functions, just for compilation sake.
- stock IsVehicleValidForSettings(var){
- #pragma unused var
- return 1;
- }
- stock FinalizeLoading(){
- SetWorldTime(MapTime); // We'll atleast set your map time
- SetWeather(Weather); // Also your weather. Ain't that nice of us?
- return 1;
- }
- stock SpawnedFunction(playerid){
- TogglePlayerControllable(playerid,1);
- return 1;
- }
- public OnPlayerConnect(playerid){
- #if defined OnPlayerConEx
- OnPlayerConEx(playerid); // Call the maps version of this too, incase you want to test something you put there.
- #endif
- TogglePlayerControllable(playerid,1);
- return 1;
- }
- public OnPlayerUpdate(playerid){
- #if defined OnPlayerUpdateEx
- OnPlayerUpdateEx(playerid);
- #endif
- return 1;
- }
- public OnPlayerDeath(playerid,killerid,reason){
- #if defined OnPlayerDeathEx
- OnPlayerDeathEx(playerid,killerid,reason); // Call the maps version of this too, incase you want to test something you put there.
- #endif
- return 1;
- }
- public OnPlayerDisconnect(playerid,reason)
- {
- #if defined OnPlayerDisconnectEx
- OnPlayerDisconnectEx(playerid,reason); // Call the maps version of this too, incase you want to test something you put there.
- #endif
- return 1;
- }
- main(){}
- // And now lets do some real functions. For the sake of testing the map.
- public OnPlayerCommandText(playerid, cmdtext[]){
- if(strcmp(cmdtext,"/help",true) ==0)
- {
- SendClientMessage(playerid,COLOR_GREY,"Hi. Thanks for making a map! This is the test script for your map. There are some commands, listed below.");
- SendClientMessage(playerid,COLOR_GREY,"To spawn all possible spawnplaces, to check for bad spawns - type /spawnall");
- SendClientMessage(playerid,COLOR_GREY,"To spawn using only small vehicles (A Landstalker is used for this) - type /spawnsmall");
- SendClientMessage(playerid,COLOR_GREY,"To spawn using only big vehicles (A Bus is used for this) - type /spawnbig.");
- SendClientMessage(playerid,COLOR_GREY,"To spawn using only huge vehicles (Dumpers & Harvesters are used for this) - type /spawnhuge.");
- SendClientMessage(playerid,COLOR_GREY,"To delete all vehicles (including any you're in) use /destroyall");
- SendClientMessage(playerid,COLOR_GREY,"To test if you're above or below the Z_LIMIT, type /zcheck");
- SendClientMessage(playerid,COLOR_GREY,"If you need to kill yourself. Type /kill");
- return 1;
- }
- if(strcmp(cmdtext,"/zcheck",true) == 0)
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid,x,y,z);
- if(MAX_Z != -0.1){
- if(z > MAX_Z) SendClientMessage(playerid,COLOR_GREY,"You're ABOVE the MAX_Z limit. You WOULD be eliminated here.");
- else if(z < MAX_Z) SendClientMessage(playerid,COLOR_GREY,"You're BELOW the MAX_Z limit. You would NOT be eliminated here.");
- else if(z == MAX_Z) SendClientMessage(playerid,COLOR_GREY,"You're exactly at the MAX_Z limit. You WOULD be eliminated here.");
- }
- if(z > Z_FALLOFF) return SendClientMessage(playerid,COLOR_GREY,"You're ABOVE the z limit. You would NOT be eliminated here.");
- else if(z < Z_FALLOFF){ SendClientMessage(playerid,COLOR_GREY,"You're BELOW the z limit. You WOULD be eliminated here."); OnPlayerElimination(playerid,1,-1); return 1;}
- else if(z == Z_FALLOFF) return SendClientMessage(playerid,COLOR_GREY,"You're exactly at the z limit. You NOT be eliminated here.");
- SetPlayerHealth(playerid,0.0);
- return 1;
- }
- if(strcmp(cmdtext,"/spawnall",true) == 0)
- {
- SendClientMessage(playerid,COLOR_GREY,"Spawned all vehicles using random vehicles from your specified loadout.");
- SpawnAllVehicles(0);
- return 1;
- }
- if(strcmp(cmdtext,"/spawnbig",true) == 0)
- {
- SendClientMessage(playerid,COLOR_GREY,"Spawned all vehicles using a large vehicle.");
- SpawnAllVehicles(1);
- return 1;
- }
- if(strcmp(cmdtext,"/spawnsmall",true) == 0)
- {
- SendClientMessage(playerid,COLOR_GREY,"Spawned all vehicles using a small vehicle.");
- SpawnAllVehicles(2);
- return 1;
- }
- if(strcmp(cmdtext,"/spawnhuge",true) == 0)
- {
- SendClientMessage(playerid,COLOR_GREY,"Spawned all vehicles using a huge vehicle.");
- SpawnAllVehicles(3);
- return 1;
- }
- if(strcmp(cmdtext,"/destroyall",true) == 0)
- {
- SendClientMessage(playerid,COLOR_GREY,"Destroyed all vehicles.");
- SpawnAllVehicles(4);
- return 1;
- }
- if(strcmp(cmdtext,"/kill",true) == 0)
- {
- SetPlayerHealth(playerid,0.0);
- return 1;
- }
- return 0;
- }
- stock SpawnAllVehicles(type){
- // type: 0 = normal, 1 = big only, 2 = small only, 3 = huge only, 4 = delete all
- for(new i = 0; i < 500; i++)
- {
- if(type != 4){ UserVehicleCreate(i,type); }
- else{
- Delete3DTextLabel(CSV[i]);
- DestroyVehicle(i);
- }
- }
- return 1;
- }
- stock CreateSumoVehicle(playerid,model,Float:X,Float:Y,Float:Z,Float:A,void1=-1,void2=-1,void3=-1){
- #pragma unused void3
- CreateVehicle(model,Float:X,Float:Y,Float:Z,Float:A,void1,void2,5);
- new string[50];
- format(string,sizeof(string),"PlayerID %d spawns here!",playerid);
- CSV[playerid] = Create3DTextLabel(string, 0xFFFFFFFF,X,Y,Z,180.0, 0, 0);
- return 1;
- }
- enum DynSpawns // store dynamic things
- {
- Float:vX,
- Float:vY,
- Float:vZ,
- Float:vA
- };
- new DynamicSpawns[100][DynSpawns], totalDynSpawns;
- AddDynamicSpawn(Float:X,Float:Y,Float:Z,Float:A)
- {
- DynamicSpawns[totalDynSpawns][vX] = X;
- DynamicSpawns[totalDynSpawns][vY] = Y;
- DynamicSpawns[totalDynSpawns][vZ] = Z;
- DynamicSpawns[totalDynSpawns][vA] = A;
- totalDynSpawns++;
- }
- stock UserVehicleCreate(playerid,type){
- new veid; // Get random vehicle from the allowed array you specified in loadout.
- if(type == 1) veid = 431; // Bus
- else if(type == 2) veid = 400; // Landstalker
- for(new i = 0; i < sizeof(totalDynSpawns); i++)
- {
- if(type == 3) { new r = random(2); if(r == 0) veid = 406; else veid = 532; } // Dumper / Harvester
- DynamicallySpawnPlayer(playerid,veid);
- }
- return 1;
- }
- stock DynamicallySpawnPlayer(playerid,model)
- {
- new thisid;
- thisid = CreateVehicle(model,DynamicSpawns[playerid][vX],DynamicSpawns[playerid][vY],DynamicSpawns[playerid][vZ],DynamicSpawns[playerid][vA],-1,-1,5);
- PutPlayerInVehicle(playerid,thisid,0);
- return thisid;
- }
- stock GetRandomSkin(playerid)
- {
- #pragma unused playerid
- // nothing, placeholder
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- new Float:pX,Float:pY,Float:pZ,Float:pA; // Real sumo core deletes ramps after 3 to 5 seconds.
- if(ALLOW_RAMP_SPAWNING == 1 && IsPlayerInAnyVehicle(playerid)){
- if ((newkeys & KEY_LOOK_BEHIND ) && !(oldkeys & KEY_LOOK_BEHIND )) // MMB / 2
- {
- GetPlayerPos(playerid,pX,pY,pZ);
- GetPlayerFacingAngle(playerid,pA);
- GetXYInFrontOfPlayer(playerid,pX,pY,12.5);
- CreateObject(1245,pX,pY,pZ,pA,0.0,0.0,500);
- }
- }
- return 1;
- }
- stock GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
- {
- new Float:a;
- GetPlayerPos(playerid, x, y, a);
- GetPlayerFacingAngle(playerid, a);
- if (GetPlayerVehicleID(playerid)) {
- GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
- }
- x += (distance * floatsin(-a, degrees));
- y += (distance * floatcos(-a, degrees));
- }
- // End of file.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement