Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <mapandreas>
- // Mode:
- // With MAP_ANDREAS_MODE_MINIMAL the only file required in the /scriptfiles/ folder is: SAMapMin.hmap, which is 7 MB.
- // With MAP_ANDREAS_MODE_FULL the only file required in the /scriptfiles/ folder is: SAMapFull.hmap which is 70 MB.
- // The difference between the modes is small, MAP_ANDREAS_MODE_FULL is 3x more accurate than MAP_ANDREAS_MODE_MINIMAL. but requires a 70 MB file instead of a 7 MBm you decide.
- // if you have a good upload speed and can upload 70 MB to your server then i would definetly switch to MAP_ANDREAS_MODE_FULL.
- // else use minimal, the difference is very slight.
- #define MODE MAP_ANDREAS_MODE_MINIMAL
- #define DEBUG 0
- public OnFilterScriptInit() { MapAndreas_Init(MODE); }
- public OnFilterScriptExit() { MapAndreas_Unload(); }
- public OnPlayerUpdate(playerid) {
- #if DEBUG == 1
- new ticks = tickcount();
- #endif
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- new Float:vX, Float:vY, Float:vZ;
- GetPlayerVelocity(playerid, vX, vY, vZ);
- new Float:targetZ;
- MapAndreas_FindAverageZ(X, Y, targetZ);
- if(Z < targetZ && vZ < -0.4) {
- if(IsPlayerInRangeOfPoint(playerid, 35, 266.405334, 1884.246704, -0.192700) == 1) return 1; // this fixes an issue with the hole at Area 51
- if(IsPlayerInAnyVehicle(playerid)) {
- SetVehiclePos(GetPlayerVehicleID(playerid), X, Y, targetZ+3);
- } else {
- SetPlayerPos(playerid, X+random(5), Y+random(5), targetZ+3);
- }
- }
- #if DEBUG == 1
- new str[128];
- format(str, sizeof(str), "took %d ms", tickcount()-ticks);
- SendClientMessage(playerid, -1, str);
- printf("took: %d ms", tickcount()-ticks);
- #endif
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement