Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Mötley

#1
Description:
Auto removed from vehicle after gaining entry.

Reproducible:
Always, Highly happens on motorbikes, player will stand on top of where he/she was driving

What you were doing when the bug happened:
Running after a vehicle for a fast take off

What you think caused the bug:
Idk, it might of thought I attempted to steal someones vehicle so instead of syncing that it ejected me instead. Only thought.

This even happens on my server
#2
I noticed the -1 setting for car colours does not follow Carcols.dat. Some of the vehicles look bad.
For example:
https://cdn.discordapp.com/attachments/495234217987276810/500897701760860180/2018-10-14_01-05-59-0380.png

So I figured why not add them any who.

[noae]function ColourSlot(vehicle_model, iD) {
 local Generator, Colour;
 switch (vehicle_model) {

  case 130: {
  Generator = ( GetTickCount() % 7 ), Colour = [ [11,73], [18,74], [47,75], [41,76], [64,73], [52,74], [56,75], [32,76] ];
  return Colour[Generator][iD];
  }

  case 131: {
  Generator = ( GetTickCount() % 7 ), Colour = [ [62,37], [78,38], [2,62], [3,87], [2,78], [5,78], [5,62], [7,78] ];
  return Colour[Generator][iD];
  }

  case 132: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [5,5], [6,6], [10,10], [35,35], [33,33], [8,8], [2,2], [3,3] ]
  return Colour[Generator][iD];
  }

  case 133: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [13,76], [24,77], [63,78], [42,76], [54,77], [39,78], [11,76], [62,77] ];
  return Colour[Generator][iD];
  }

  case 134: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [18,1], [37,1], [55,1], [59,1], [43,1], [47,1], [66,1], [31,1] ];
  return Colour[Generator][iD];
  }

  case 135: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [30,0], [2,0], [36,0], [8,0], [10,0], [11,0], [14,0], [49,0] ];
  return Colour[Generator][iD];
  }

  case 136: {
    Generator = ( 0 ), Colour = [ [1,1] ];
  return Colour[Generator][iD];
  }

  case 137: {
    Generator = ( 0 ), Colour = [ [3,1] ];
  return Colour[Generator][iD];
  }

  case 138: {
  Generator = ( 0 ), Colour = [ [1,75] ];
  return Colour[Generator][iD];
  }

  case 139: {
  Generator = ( GetTickCount() % 3 ), Colour = [ [84,84], [1,1], [79,79], [78,78] ];
  return Colour[Generator][iD];
  }

  case 140: {
  Generator = ( GetTickCount() % 7 ), Colour = [ [58,1], [69,1], [75,77], [18,1], [32,1], [45,45], [13,1], [34,1] ];
  return Colour[Generator][iD];
  }

  case 140: {
  Generator = ( GetTickCount() % 7 ), Colour = [ [58,1], [69,1], [75,77], [18,1], [32,1], [45,45], [13,1], [34,1] ];
  return Colour[Generator][iD];
  }

  case 141: {
  Generator = ( GetTickCount() % 4 ), Colour = [ [2,2], [11,11], [12,12], [35,35], [36,36] ];
  return Colour[Generator][iD];
  }

  case 142: {
  Generator = ( 0 ), Colour = [ [13,72] ];
  return Colour[Generator][iD];
  }
  case 143: {
  Generator = ( GetTickCount() % 7 ), Colour = [ [62,62], [58,58], [62,62], [58,58], [32,32], [88,88], [1,1], [3,3] ];
  return Colour[Generator][iD];
  }
 
  case 144: {
    Generator = ( GetTickCount() % 5 ), Colour = [ [63,63], [67,67], [69,69], [91,91], [3,3], [7,7] ];
    return Colour[Generator][iD];
  }

  case 145: {
    Generator = ( GetTickCount() % 5 ), Colour = [ [25,25], [36,36], [52,52], [3,3], [53,53], [76,76] ];
    return Colour[Generator][iD];
  }

  case 146: {
    Generator = ( 0 ), Colour = [ [1,3] ];
    return Colour[Generator][iD];
  }

  case 147: {
    Generator = ( 0 ), Colour = [ [71,73] ];
    return Colour[Generator][iD];
  }
 
  case 148: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [43,43], [48,48], [54,54], [61,61], [64,64], [9,9], [13,13], [32,32] ];
    return Colour[Generator][iD];
  }

  case 149: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [45,75], [47,76], [33,75], [13,76], [54,75], [69,76], [59,75], [87,76] ];
    return Colour[Generator][iD];
  }

  case 150: {
    Generator = ( GetTickCount() % 2 ), Colour = [ [6,75], [6,73], [6,76] ];
    return Colour[Generator][iD];
  }

  case 151: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [9,9], [30,30], [36,36], [42,42], [13,13], [25,25], [54,54], [60,60] ];
    return Colour[Generator][iD];
  }

  case 152: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [5,8], [32,8], [43,8], [67,8], [11,11], [8,90], [2,2], [83,13] ];
    return Colour[Generator][iD];
  }

  case 153: {
    Generator = ( GetTickCount() % 5 ), Colour = [ [1,16], [1,56], [1,17], [1,53], [1,5], [1,35] ];
    return Colour[Generator][iD];
  }

  case 154: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [54,37], [13,1], [25,1], [38,59], [42,1], [46,1], [55,1], [2,37] ];
    return Colour[Generator][iD];
  }

  case 155: {
    Generator = ( 0 ), Colour = [ [43,0] ];
    return Colour[Generator][iD];
  }

  case 156: {
    Generator = ( 0 ), Colour = [ [46,1] ];
  return Colour[Generator][iD];
  }

  case 157: {
    Generator = ( 0 ), Colour = [ [46,1] ];
    return Colour[Generator][iD];
  }

  case 158: {
    Generator = ( 0 ), Colour = [ [4,75] ];
    return Colour[Generator][iD];
  }

  case 159: {
    Generator = ( GetTickCount() % 3 ), Colour = [ [1,1], [3,3], [36,36], [57,57] ];
    return Colour[Generator][iD];
  }

  case 160: {
    Generator = ( 0 ), Colour = [ [46,1] ];
    return Colour[Generator][iD];
  }

  case 161: {
    Generator = ( GetTickCount() % 5 ), Colour = [ [43,82], [48,82], [56,82], [58,82], [63,82], [2,82] ];
    return Colour[Generator][iD];
  }

  case 162: {
  // Tank does not exist, use green for colisions
    Generator = ( 0 ), Colour = [ [43,43] ];
    return Colour[Generator][iD];
  }

  case 163: {
  // cuban hermes does not exist, use black for colisions
    Generator = ( 0 ), Colour = [ [43,0] ];
    return Colour[Generator][iD];
  }

  case 164: {
    Generator = ( 0 ), Colour = [ [0,6] ];
    return Colour[Generator][iD];
  }

  case 166: {
    Generator = ( 0 ), Colour = [ [14,75] ];
    return Colour[Generator][iD];
  }

  case 167: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [56,75], [75,79], [13,76], [44,27], [67,77], [55,52], [21,26], [74,15] ];
    return Colour[Generator][iD];
  }

  case 168: {
    Generator = ( 0 ), Colour = [ [6,76] ];
    return Colour[Generator][iD];
  }

  case 169: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [57,8], [8,17], [43,21], [54,38], [67,8], [37,78], [65,79], [25,78] ];
    return Colour[Generator][iD];
  }

  case 170: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [78,73], [16,72], [1,75], [18,74], [88,88], [37,1], [59,59], [19,19] ];
    return Colour[Generator][iD];
  }

  case 171: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [17,27], [28,38], [38,47], [46,57], [41,27], [57,48], [67,58], [64,37] ];
    return Colour[Generator][iD];
  }

  case 172: {
    Generator = ( GetTickCount() % 4 ), Colour = [ [0,1], [70,1], [71,1], [72,1], [73,1] ];
    return Colour[Generator][iD];
  }

  case 173: {
    Generator = ( GetTickCount() % 6 ), Colour = [ [74,76], [93,77], [76,78], [15,76], [31,77], [43,78], [48,76] ];
    return Colour[Generator][iD];
  }

  case 174: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [51,0], [61,0], [41,0], [11,0], [64,0], [40,0], [38,0], [10,0] ];
    return Colour[Generator][iD];
  }

  case 175: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [37,37], [42,42], [53,53], [62,62], [7,7], [10,10], [11,11], [15,15] ];
    return Colour[Generator][iD];
  }

  case 176: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [1,3], [1,5], [1,16], [1,22], [1,35], [1,44], [1,53], [1,57] ];
    return Colour[Generator][iD];
  }

  case 177: {
    Generator = ( 0 ), Colour = [ [75,2] ];
    return Colour[Generator][iD];
  }

  case 178: {
    Generator = ( 0 ), Colour = [ [14,6] ];
    return Colour[Generator][iD];
  }

  case 179: {
    Generator = ( 0 ), Colour = [ [16,74] ];
    return Colour[Generator][iD];
  }

  case 182: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [1,3], [1,5], [1,16], [1,22], [1,35], [1,44], [1,53], [1,57] ];
    return Colour[Generator][iD];
  }

  case 183: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [57,8], [8,17], [43,21], [54,38], [67,8], [37,78], [65,79], [25,78] ];
    return Colour[Generator][iD];
  }

  case 184: {
    Generator = ( 0 ), Colour = [ [1,1] ];
    return Colour[Generator][iD];
  }

  case 185: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [84,15], [84,58], [84,31], [32,74], [43,31], [1,31], [77,31], [32,74] ];
    return Colour[Generator][iD];
  }

  case 186: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [28,72], [36,73], [48,74], [59,72], [67,73], [34,74], [13,72], [18,73] ];
    return Colour[Generator][iD];
  }

  case 187: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [58,1], [2,1], [5,1], [18,1], [32,1], [45,1], [13,1], [34,1] ];
    return Colour[Generator][iD];
  }

  case 188: {
    Generator = ( 0 ), Colour = [ [12,73] ];
    return Colour[Generator][iD];
  }

  case 189: {
    Generator = ( 0 ), Colour = [ [88,75] ];
    return Colour[Generator][iD];
  }

  case 190: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [1,3], [1,5], [1,16], [1,22], [1,35], [1,44], [1,53], [1,57] ];
    return Colour[Generator][iD];
  }

  case 191: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [13,13], [22,22], [35,35], [38,38], [2,2], [3,3], [48,48], [51,51] ];
    return Colour[Generator][iD];
  }

  case 192: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [2,37], [68,78], [11,79], [15,8], [33,37], [44,78], [56,79], [60,8] ];
    return Colour[Generator][iD];
  }

  case 193: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [79,79], [84,84], [7,7], [11,11], [19,19], [22,22], [36,36], [53,53] ];
    return Colour[Generator][iD];
  }

  case 194: {
    Generator = ( 0 ), Colour = [ [14,75] ];
    return Colour[Generator][iD];
  }

  case 195: {
    Generator = ( 0 ), Colour = [ [14,75] ];
    return Colour[Generator][iD];
  }

  case 196: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [67,76], [68,76], [78,76], [2,76], [16,76], [18,76], [25,76], [45,88] ];
    return Colour[Generator][iD];
  }

  case 197: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [51,1], [58,8], [60,1], [68,8], [2,1], [13,8], [22,1], [36,8] ];
    return Colour[Generator][iD];
  }

  case 198: {
    Generator = ( GetTickCount() % 3 ), Colour = [ [6,6], [46,46], [53,53], [3,3] ];
    return Colour[Generator][iD];
  }

  case 199: {
    Generator = ( 0 ), Colour = [ [75,2] ];
    return Colour[Generator][iD];
  }

  case 200: {
    Generator = ( 0 ), Colour = [ [43,0] ];
    return Colour[Generator][iD];
  }

  case 201: {
    Generator = ( 0 ), Colour = [ [13,13] ];
    return Colour[Generator][iD];
  }

  case 202: {
    Generator = ( GetTickCount() % 1 ), Colour = [ [1,15], [1,53] ];
    return Colour[Generator][iD];
  }

  case 203: {
    Generator = ( GetTickCount() % 1 ), Colour = [ [1,15], [1,53] ];
    return Colour[Generator][iD];
  }

  case 204: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [2,2], [16,16], [17,17], [21,21], [32,32], [38,38], [43,43], [60,60] ];
    return Colour[Generator][iD];
  }

  case 205: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [2,39], [9,39], [17,1], [21,1], [33,0], [37,0], [41,29], [56,29] ];
    return Colour[Generator][iD];
  }

  case 206: {
    Generator = ( 0 ), Colour = [ [16,16] ];
    return Colour[Generator][iD];
  }

  case 207: {
    Generator = ( GetTickCount() % 8 ), Colour = [ [1,1], [3,3], [2,2], [6,6], [79,41], [8,41], [12,76], [16,76], [23,76] ];
    return Colour[Generator][iD];
  }

  case 208: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [72,72], [93,93], [4,4], [11,11], [42,42], [51,51], [60,60], [64,64] ];
    return Colour[Generator][iD];
  }

  case 209: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [53,32], [15,32], [45,32], [34,30], [65,32], [14,32], [12,32], [43,32] ];
    return Colour[Generator][iD];
  }

  case 210: {
    Generator = ( GetTickCount() % 6 ), Colour = [ [1,1], [12,12], [2,2], [6,6], [4,4], [46,46], [53,53] ];
    return Colour[Generator][iD];
  }

  case 211: {
    Generator = ( GetTickCount() % 3 ), Colour = [ [1,1], [3,3], [6,6], [46,46] ];
    return Colour[Generator][iD];
  }

  case 212: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [41,41], [48,48], [52,52], [64,64], [71,71], [85,85], [10,10], [62,62] ];
    return Colour[Generator][iD];
  }

  case 213: {
    Generator = ( GetTickCount() % 5 ), Colour = [ [9,9], [32,32], [69,69], [73,73], [81,81], [34,34] ];
    return Colour[Generator][iD];
  }

  case 214: {
    Generator = ( GetTickCount() % 3 ), Colour = [ [12,35], [50,32], [40,26], [66,36] ];
    return Colour[Generator][iD];
  }

  case 215: {
    Generator = ( GetTickCount() % 6 ), Colour = [ [1,73], [1,74], [1,75], [1,76], [1,77], [1,78], [1,79] ];
    return Colour[Generator][iD];
  }

  case 216: {
    Generator = ( 0 ), Colour = [ [6,76] ];
    return Colour[Generator][iD];
  }

  case 217: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [1,14], [1,42], [1,57], [54,1], [1,3], [3,1], [12,39], [74,35] ];
    return Colour[Generator][iD];
  }

  case 218: {
    Generator = ( 0 ), Colour = [ [1,2] ];
    return Colour[Generator][iD];
  }

  case 219: {
    Generator = ( GetTickCount() % 5 ), Colour = [ [32,3], [32,42], [32,53], [32,66], [32,14], [32,32] ];
    return Colour[Generator][iD];
  }

  case 220: {
    Generator = ( 0 ), Colour = [ [6,6] ];
    return Colour[Generator][iD];
  }

  case 221: {
    Generator = ( GetTickCount() % 5 ), Colour = [ [40,65], [71,72], [52,66], [64,72], [30,72], [60,72] ];
    return Colour[Generator][iD];
  }

  case 222: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [78,78], [80,13], [2,78], [11,79], [16,8], [25,8], [33,78], [42,79] ];
    return Colour[Generator][iD];
  }

  case 223: {
    Generator = ( 0 ), Colour = [ [36,13] ];
    return Colour[Generator][iD];
  }

  case 224:
  case 233: {
    Generator = ( GetTickCount() % 5 ), Colour = [ [7,53], [3,40], [35,53], [40,75], [42,2], [46,6] ];
    return Colour[Generator][iD];
  }

  case 225: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [15,78], [49,78], [69,78], [45,78], [51,78], [66,78], [56,78], [12,78] ];
    return Colour[Generator][iD];
  }

  case 226: {
    Generator = ( GetTickCount() % 8 ), Colour = [ [8,1], [12,1], [16,1], [22,1], [34,1], [35,1], [41,1], [42,1], [54,1] ];
    return Colour[Generator][iD];
  }

  case 227: {
    Generator = ( 0 ), Colour = [ [46,1] ];
    return Colour[Generator][iD];
  }

  case 228: {
    Generator = ( GetTickCount() % 6 ), Colour = [ [22,77], [32,76], [46,75], [57,74], [66,74], [78,75], [1,74] ];
    return Colour[Generator][iD];
  }

  case 229: {
    Generator = ( GetTickCount() % 6 ), Colour = [ [87,54], [87,64], [8,2], [33,55], [56,69], [89,11], [33,2] ];
    return Colour[Generator][iD];
  }

  case 230: {
    Generator = ( GetTickCount() % 6 ), Colour = [ [30,65], [48,65], [64,68], [64,71], [11,73], [60,68], [74,64] ];
    return Colour[Generator][iD];
  }

  case 231: {
    Generator = ( 0 ), Colour = [ [14,75] ];
    return Colour[Generator][iD];
  }

  case 232: {
    Generator = ( GetTickCount() % 5 ), Colour = [ [2,35], [36,2], [51,53], [91,2], [11,22], [40,35] ];
    return Colour[Generator][iD];
  }

  case 234: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [51,9], [57,1], [45,9], [34,1], [65,9], [14,1], [12,9], [26,1] ];
    return Colour[Generator][iD];
  }

  case 235: {
    Generator = ( GetTickCount() % 7 ), Colour = [ [51,39], [57,38], [45,29], [34,9], [65,9], [14,1], [12,9], [26,1] ];
    return Colour[Generator][iD];
  }

  case 236: {
    Generator = ( GetTickCount() % 4 ), Colour = [ [3,3], [6,6], [7,7], [52,52], [76,76] ];
    return Colour[Generator][iD];
  }

  default: {
  // Shouldn't ever get called
    Generator = ( 0 ), Colour = [ [-1, -1] ];
  return Colour[Generator][iD];
  }
 }
}
[/noae]
There were a few modifications, I noticed vcmp likes to show paint during collisions for all vehicles when story mode doesn't do that for certain vehicles, For example the Sabre Turbo is actually blue in the Carcols file so the fact that vcmp loads that is a little weird so I manually changed some of the vehicles colours to match the colour of the vehicles for collisions.

Hopefully this tiny snippet will help someone with there server, maybe you want to modify colours or whatever, regardless this should help!
I used integers instead of vehicle names as squirrel has a harder time finding strings vs integers

Examples:
[noae]   
local c1 = ColourSlot(model, 0);
local c2 = ColourSlot(model, 1);
CreateVehicle( model, player.Pos, player.Angle, c1, c2 );
[/noae]

[noae]function onVehicleRespawn(vehicle) {
  // Set vehicles to respawn with random colour
  vehicle.Colour1 = ColourSlot(vehicle.Model, 0);
  vehicle.Colour2 = ColourSlot(vehicle.Model, 1);
}
[/noae]

If you find any issues with the behavior of colours in this script, or anything in general please let me know :)
#3
Player.Angle never updates while in a vehicle. While vehicle.Angle seems broken, it's not broken.
The only part about Vehicle.Angle that's broken is returning vehicle angles, You can set the angle normally based off of player.Angle just fine.

Also Player.Angle returns your last known angle from when you first entered your current vehicle, when you exit a vehicle it returns that angle. But it does start to update around 100 ms after exiting a vehicle, It just returns your last angle for some odd reason, The fact that it never updates while in vehicle is why most users have bugged angles when using player.Angle as a angle for vehicles, it just never updates.

So my request is to force Player.Angle to update while in a vehicle, and not to return the players last know angle when exiting a vehicle. If player.Angle updates it shouldn't do that anyway or at least don't set it for the last known angle, just putting that out there to be sure it get's noted.

I have a snippet from testing, this is for flipping a vehicle back over/sets your vehicles angle to be the same as your current vehicle facing angle.

Leave the timer as is, unless  you want to see how player.Angle returns your last known angle vs your current facing angle.
Hopefully this will help explain what I am talking about as I have the flu and don't feel to well :-[

    if (cmd == "flip") {
      // refresh vehicle
      local vehicle = FindVehicle(player.Vehicle.ID), Vehicle_Model = player.Vehicle.Model, vpos = player.Vehicle.Pos, c1 = player.Vehicle.Colour1, c2 = player.Vehicle.Colour2;
      if (vehicle) {
        // Vehicle fliping around like crazy could possibly cause player.Angle to not update for the given time
        if (vehicle.Speed.x < 0.00005 && vehicle.Speed.y < 0.00005) {
            player.Frozen = true;
            vehicle.Remove();
            // Needs a slight offset as it happens so fast it goes unnoticed
            NewTimer("FlipVehicle", 100, 1, Vehicle_Model, player.ID, vpos.x, vpos.y, vpos.z, c1, c2 );
        }
      }
    }

function FlipVehicle( model, fplayer, x, y, z, c1, c2 )
{
    local player = FindPlayer(fplayer);
    if (player) {
        local vehicle = CreateVehicle( model, Vector(x, y, z), player.Angle, c1, c2);
        player.Vehicle = vehicle;
        player.Frozen = false;
        Message("Vehicle angle returns: " + player.Angle);
    }
}

I'm just the new guy
#4
Welcome to the Unofficial Vice City Multiplayer Discord

This discord was designed to bring the community together, and build people up. Users range from, Server owners, Scripters, clan members, to much more as it's going to grow!

Hate towards any member will not be tolerated and will result in a permanent ban regardless as to who you are.

On your arrival please announce to us what you are here for.

If you are just a player let us know and we will assign a role for you, as well If you are just a server owner, just a scripter to whatever. You have to be something vcmp related or you will be kicked.

The Player role could be notified at anytime for upcoming events, Getting players together to anything really. Same for server owners needing to unit to find a fix to any player bugs at the time which could range to anything, clans wanting to get together for a war. If you are a scripter there's also a special role for you to :P.


Give it a shot!

https://discord.gg/TBr4a7

If creating a discord for vcmp is not allowed just let me know, I also have no problem handing over the crown to developers if there interested in it at anytime and want to take over
#5
There's no real Island return in the wiki, So I had to work with what we already have.

I don't know who the originator of:
function GetDistance(pos1, pos2) {
    return sqrt(pow(pos1.x - pos2.x, 2) + pow(pos1.y - pos2.y, 2) + pow(pos1.z - pos2.z, 2));
}
But if someone could tell me I would like to leave credits to that individual ;)


The script is a real basic Island/nearest hospital return. It took a heck of a lot of testing One entire day to get it right, if you encounter any bugs please tell me as it's a huge map. I literally tested coordinates all over the map but I'm sure I missed something somewhere, somehow.

I haven't set the players angle on spawn

I don't really ever see anyone needing this as all I have seen is team death matches in vcmp, so something like this would be useless to these individual :c lol. 

I hope you enjoy it, as well if you happened to stumble upon it and really needed it I'm glad I was able to help you ;)
/*
    Server: The American Server
    Coding by: Motley
*/

// One equals first biggest Island/ Two equals all center Islands/ Three equals other big Island
Player_Island <- array( GetMaxPlayers(), 0 );
// North and South/one/two
Player_Locator <- array( GetMaxPlayers(), 0 );

// Death Spawn
Hospital_Spawn <- array( GetMaxPlayers(), false );
HospitalSpawnLocations <- [ Vector( -886.074,-470.278,13.1109 ), Vector( -783.051,1141.83,12.4111), Vector( 467.763,697.68,11.7033 ), Vector( -135.137,-981.579,10.4634 ) ];
Hospital_Locator <- array( GetMaxPlayers() );

District_ID <- array(120, 0);
District_Name <- array(120, "");

//-----------------------------------------------------------------------------------------

function SetPlayersDistrict(Name, player) {
    switch(Name) {
        /* First Island */
        case "Vice Point":                             return District_ID[player.ID] = 1;
        case "Ocean Beach":                            return District_ID[player.ID] = 2;
        case "Washington Beach":                       return District_ID[player.ID] = 3;
       
        /* Center Shit */
        case "Leaf Links":                             return District_ID[player.ID] = 4;
        case "Starfish Island":                        return District_ID[player.ID] = 5;
        case "Prawn Island":                           return District_ID[player.ID] = 6;

        /* Third Island */
        case "Escobar International Airport":          return District_ID[player.ID] = 7;
        case "Downtown Vice City":                     return District_ID[player.ID] = 8;
        case "Junkyard":                               return District_ID[player.ID] = 9;
        case "Little Haiti":                           return District_ID[player.ID] = 10;
        case "Little Havana":                          return District_ID[player.ID] = 11;
        case "Little Haiti":                           return District_ID[player.ID] = 12;
       
        case "Viceport":                               return District_ID[player.ID] = 13;
        case "Vice City":                              return District_ID[player.ID] = 14;
        default:                                       return District_ID[player.ID] = 0;
    }
}

//-----------------------------------------------------------------------------------------

function GetPlayerIsland(player) {
    if ( ( District_ID[player.ID] >= 1 ) && ( District_ID[player.ID] <= 3 ) ) {
        if (NearestHospital(player.Pos) == 1 ) {
            Player_Island[player.ID] = 1;
            Player_Locator[player.ID] = 1;
        }
        if (NearestHospital(player.Pos) == 2 ) {
            Player_Island[player.ID] = 1;
            Player_Locator[player.ID] = 2;
        }
    }

    if ( ( District_ID[player.ID] >= 4 ) && ( District_ID[player.ID] <= 6 ) ) {
         if (NearestHospital(player.Pos) == 1 ) {
            Player_Island[player.ID] = 2;
            Player_Locator[player.ID] = 1;
        }
         if (NearestHospital(player.Pos) == 2 ) {
            Player_Island[player.ID] = 2;
            Player_Locator[player.ID] = 2;
        }   
     }

    if ( ( District_ID[player.ID] >= 7 ) && ( District_ID[player.ID] <= 12 ) ) {
         if (NearestHospital(player.Pos) == 1 ) {
            Player_Island[player.ID] = 3;
            Player_Locator[player.ID] = 1;
        }         
        if (NearestHospital(player.Pos) == 2 ) {
            Player_Island[player.ID] = 3;
            Player_Locator[player.ID] = 2;   
        }
    }

    if ( ( District_ID[player.ID] == 13 ) || ( District_ID[player.ID] == 0 ) || ( District_ID[player.ID] == 14 )) {
         if ((GetIsland(player.Pos) == 1 ) && ( NearestHospital(player.Pos) == 1 )) {
            Player_Island[player.ID] = 1;
            Player_Locator[player.ID] = 1;
         }
         if ((GetIsland(player.Pos) == 1 ) && ( NearestHospital(player.Pos) == 2 )) {
            Player_Island[player.ID] = 1;
            Player_Locator[player.ID] = 2;
         }         
         if ((GetIsland(player.Pos) == 2 ) && ( NearestHospital(player.Pos) == 1 )) {
            Player_Island[player.ID] = 2;
            Player_Locator[player.ID] = 1;   
         }       
         if ((GetIsland(player.Pos) == 2 ) && ( NearestHospital(player.Pos) == 2 )) {
            if (player.Pos.x < -500 ) {
              Player_Island[player.ID] = 3;
              Player_Locator[player.ID] = 2;
            }
            else{
                Player_Island[player.ID] = 2;
                Player_Locator[player.ID] = 2;
            }
         }
         if ((GetIsland(player.Pos) == 3 ) && ( NearestHospital(player.Pos) == 1 )) {
            Player_Island[player.ID] = 3;
            Player_Locator[player.ID] = 1;
         }
         if ((GetIsland(player.Pos) == 3 ) && ( NearestHospital(player.Pos) == 2 )) {
              Player_Island[player.ID] = 3;
              Player_Locator[player.ID] = 2;
         }
    }
}

//-----------------------------------------------------------------------------------------

function GetNearestHospital(player) {
    Hospital_Spawn[player.ID] = true;
    Hospital_Locator[player.ID] = player.Pos;   

    District_Name[player.ID] = GetDistrictName(player.Pos.x, player.Pos.y);
   
    SetPlayersDistrict(District_Name[player.ID], player); //Do not remove player, LOL..

    GetPlayerIsland(player);
    if ( Player_Island[player.ID] == 1 ) {
        local
        pos = player.Pos,
        first_check = GetDistance(HospitalSpawnLocations[2], pos).tointeger(),
        second_check = GetDistance(HospitalSpawnLocations[3], pos).tointeger();

        if (first_check <= second_check ) Hospital_Locator[player.ID] = HospitalSpawnLocations[2];
        else if (second_check <= first_check )   Hospital_Locator[player.ID] = HospitalSpawnLocations[3];   
    }

    if ( Player_Island[player.ID] == 3 ) {
        local
        pos = player.Pos,
        first_check = GetDistance(HospitalSpawnLocations[0], pos).tointeger(),
        second_check = GetDistance(HospitalSpawnLocations[1], pos).tointeger();

        if (first_check <= second_check ) Hospital_Locator[player.ID] = HospitalSpawnLocations[0];
        else if (second_check <= first_check )   Hospital_Locator[player.ID] = HospitalSpawnLocations[1];
    }
   
    if ( Player_Island[player.ID] == 2 ) {
        if (Player_Locator[player.ID] == 1 ) {
            local
            pos = player.Pos,
            first_check = GetDistance(HospitalSpawnLocations[1], pos).tointeger(),
            second_check = GetDistance(HospitalSpawnLocations[2], pos).tointeger();

            if (first_check <= second_check ) Hospital_Locator[player.ID] = HospitalSpawnLocations[1];
            else if (second_check <= first_check ) Hospital_Locator[player.ID] = HospitalSpawnLocations[2]; 
        }

        if (Player_Locator[player.ID] == 2 ) {
            local
            pos = player.Pos,
            first_check = GetDistance(HospitalSpawnLocations[0], pos).tointeger(),
            second_check = GetDistance(HospitalSpawnLocations[3], pos).tointeger();

            if (first_check <= second_check ) Hospital_Locator[player.ID] = HospitalSpawnLocations[0];
            else if (second_check <= first_check ) Hospital_Locator[player.ID] = HospitalSpawnLocations[3];
        }
    }
}
//-----------------------------------------------------------------------------------------
function GetIsland(pos) {
 
  // First Island
  if (pos.x > -170) return 1;
  // Third Island
  if (pos.x < -716) return 3;
 
  // Center island BS
  return 2;
}

function NearestHospital(pos) {
    if (pos.y >= 0) return 1; // north hospitals
    if (pos.y <= 0) return 2; // south hospitals
}
//-----------------------------------------------------------------------------------------
function onPlayerRequestClass( player, classID, team, skin ) {
    if (Hospital_Spawn[player.ID] == true) { player.Spawn(); }
}

function onPlayerSpawn(player) {
    // Spawn data
    if (Hospital_Spawn[player.ID] == true) { player.Pos = Hospital_Locator[player.ID]; Hospital_Spawn[player.ID] = false; }
}

function onPlayerKill( killer, killed, reason, bodypart ) {
    GetNearestHospital(killed);
}
function onPlayerDeath( player, reason ) {
    GetNearestHospital(player);
}

function GetDistance(pos1, pos2)
{
    return sqrt(pow(pos1.x - pos2.x, 2) + pow(pos1.y - pos2.y, 2) + pow(pos1.z - pos2.z, 2));
}

function onPlayerPart(player, reason) {
  Player_Island[player.ID] = 0;
  Player_Locator[player.ID] = 0;
  Hospital_Spawn[player.ID] = false;
  Hospital_Locator[player.ID] = null;

  District_ID[player.ID] = 0;
  District_Name[player.ID] = "";
}

//-----------------------------------------------------------------------------------------

I'm actually getting ready to re-write this code, so have fun with it ;D

Yeah, maybe I'll be coming back with a server maybe not :P
#6
Sorry, It's been a really long work week, and my mind is not really that great from lack of sleep, and over working. This is a rather simple solution. I just cant seem to think clearly :/ regards.

Well the topic say's it all. 
I was looking at the Squirrel Docs at what made sense, http://www.squirrel-lang.org/squirreldoc/reference/language/builtin_functions.html?highlight=compare .

Please remember I'm only testing at the moment, I haven't taken the time to write to code more efficiently, this is just fundamental testing stuff. Any help on how I should go about this would be great! ;)
Hospital_Spawn <- array( GetMaxPlayers(), false ); // Has the player died
HospitalSpawnLocations <- [ Vector( -886.074,-470.278,13.1109 ), Vector( -783.051,1141.83,12.4111), Vector( 467.763,697.68,11.7033 ), Vector( -135.137,-981.579,10.4634 ) ]; // Hospital locations

Death_Loacation <- array( GetMaxPlayers() ); // Storage of the players last position upon death 'player.Pos'

// Kuddos Rwwpl
function GetDistance(v1,v2) return sqrt((v2.x-v1.x)*(v2.x-v1.x) + (v2.y-v1.y)*(v2.y-v1.y) + (v2.z-v1.z)*(v2.z-v1.z));
There's so much to compare, I don't want to go about this wrongly and end up with a huge script, when that's not even necessary.
I can get around to this eventually if no one is able to help me any time soon.
#7
I would like to know where one could learn how to use this algorithm.

I read through the vcmp search forum and could not find anything.
Tried Google, I think I found it, but I want to be sure instead of wasting my time.

https://en.wikipedia.org/wiki/Euler_angles

If this is correct and someone wouldn't mind leading me to more documentation that would be great

*Just trying to build a Pay n Sray system

#8
Off-Topic General / Learning C++
Jan 20, 2017, 09:04 AM
Hey Everyone :)

Could those that have been to college and or happened to maybe pick this book up before tell me if this is a really good book for learning C++?

First Book of C++ by Gary Bronson

https://books.google.com/books?id=LUJbzQR7KnoC&printsec=frontcover&dq=First+Book+of+C%2B%2B+by+Gary+Bronson&hl=en&sa=X&ved=0ahUKEwigyq7nrtDRAhVC6yYKHTGhA3cQ6AEILzAA#v=onepage&q=First%20Book%20of%20C%2B%2B%20by%20Gary%20Bronson&f=false

Please and Thank you :)

*One of the biggest problems of teachers is that they teach you in a perspective as if you already know it, This goes for books as well. I skimmed threw this book and this is the best I have seen
#9
Off-Topic General / Vrocker Hosting Panel
Jan 09, 2017, 01:57 PM
I would like to know if there is anyone other than Vrocker that manages Vrocker Hosting?



I went to update a old host of mine that I figured would of been a simple re-activation , Other than it still suspended and it was of no success. I have been waiting for a while now for this to be updated, This payment was done on Dec 27, 2016, So it was not too long ago 'But almost at a half month mark'.



Does he ensure that once a month he checks up on it or? Just really curious as well if anyone helps him manage Vrocker Hosting

I figured that someone like @Thijn would know of this. Or anyone that has dealt with his hosting for a long time to know of how long of a process it typically is.

Any pointers for future knowledge on Vrocker Hosting for others including myself, would be very helpful.

Please keep this topic clean!
#10
Well my server is setup to where if a player spawns a vehicle there last spawned vehicle is automatically removed.

I would to receive help on properly removing all players from that vehicle, Which means each seat, And hopefully no loop, And nothing that will alter data usage.



In the commands I added a simple array to store the vehicle.ID in, This array never gets cleared 'So far', Unless I plan to remove the vehicle on player part. So when the player spawns another vehicle that vehicle is automatically removed, Even if it belonged to another player 'Same array value, player.ID etc etc..

   
    if (Added_Vehicle[player.ID] > 0)
    {
        local vehicle = FindVehicle(Added_Vehicle[player.ID]);
        if (vehicle)
        {
            vehicle.Remove();
        }
    };

Now this is setup to prevent data usage, lag and so on.. Max limits on vehicles, command spaming vehicles into the server. Prevent server crashing.. blah blah blah....



If someone could help me with the concept of how I should go about scripting it, And maybe how I should add it to the server. I would be really happy.

Last I checked if a player/players happens to be in a vehicle and it is removed, This results in death and possible rage, Maybe even a /quit
#11
Off-Topic General / For Every hour of coding
Dec 18, 2016, 09:19 AM
For Every hour of coding I would like to encourage others to do workouts.

For me, Every hour I do 100 push-ups "Which is nothing for me" and 25 sit-ups "Only 25 as I am trying to keep the fat that I have for muscle, Not burn it off".

The reason behind this is to stay active, You are wasting a lot of time behind your PC, At-least invest it in other places, Places that you will be happy with the results.

This also helps me relax when I code. I want to sit back relax and do some coding. Typically at times I skip workouts as it's not good to over do it,

Just saying, Try it :)
#12
Hi, I would like to see if one of the developers and or someone like Thijn etc, If they could do a quickie view of

http://www.tizag.com/sqlTutorial/index.php

Of how they are teaching SQL, If from there glance threw etc appears to be trustworthy, Compared to "I'm learning it the wrong way". That's all. I really like this site so far and I would really hate to study a lot wrongly.

Please no Spam, This is a honest question as I have learned a lot from this site. I would also recommend this site,
#13
Could the developers look into re adding xml into [0.4]

Wiki examples that were in a previous VCMP

http://liberty-unleashed.co.uk/LUWiki/Squirrel/Server/Functions/XmlDocument/XmlDocument
#14
If so what would the value be?

I looked on the web and could not find anything. Unless I missed something

Not being serious with this but

Index <- array( infinite, null )
Index <- array( MAX_ARRAY_SIZE, null )

Should give you the idea

#15
In Vice City and GTA III You have positions for districts,


There usage:

Name, Type, X1, Y1, Z1, X2, Y2, Z2, Level



There format

CHINA, 0, 745.421, -908.289, -21.203, 1065.42, -463.69, 129.593, 1

@Stormeus How did the two teams go about GetDistrictName, Did you use these positions? If so how?

http://www.gtamodding.com/wiki/ZONE

I would Like to see if there is a way to use these two vectors "As is" As a poly like Rockstar did.

How would I go about this?

I have tried checking if a player is a distance from a vector but it did not work..
Maybe I am dumb ;D .. >:(
#16
Okay I have a project I plan to attack for either LU or Vcmp, or both, Not really sure which one.

I want to retrieve all of the district names from the main.scm as I want to create a kill system similar to GTA 5 where as when killed you kind of have a random spawn within that district.

Is there anything I need to know when retrieving the names from the original mission file? Are they an exact match "String names from function GetDistrictName".

This is going to be a lot of wasted freaking time and I would prefer to hear an output from someone else before even attempting something as massive as this, Sounds simple but really freaking time consuming. So I cant waste time by doing something wrong, Or hear about better ways. I'm sure someone understands..

:P I already tried creating a loop for increasing float values for GetDistrictName(pos.x, pos.y) didn't ;D work out
#17
Off-Topic General / GoldBerg
Nov 21, 2016, 12:49 PM
I found it really intense to see Goldberg back in action after not being in the ring for 12 years, I really do not watch wrestling anymore, But I had to for this match.

These two had history against each other,

https://www.youtube.com/watch?v=HgZJ5VdFnNQ#

For anyone else that knew of history of one or the other comment ;)
#18
It's nearly impossible to create delivery missions and way much more when I have to share the same created sphere with every player,

Yet the scripts could become confused on sphere.IDs if using the original method
"When referring to many players doing delivery missions, As well who knows what else the Sphere.IDs could end up doing when removing them" Yet a random player walking into that sphere causing money leak/Mission issues.

The LU team created a sphere that can be set only for the player/client "Server side".

I would prefer a better version of spheres for missions, Therefore I can not continue my server until then which really sucks if I have to remove these missions from the server..

#Please add some method of
http://liberty-unleashed.co.uk/LUWiki/Squirrel/Server/Functions/Spheres/CreateClientSphere



It would also be useful to have markers on the radar that could you set only for the client only

CreateClientBlip( pPlayer, BLIP_NONE, pPlayer.Pos );
This would create a marker that only that player could see

http://liberty-unleashed.co.uk/LUWiki/Squirrel/Server/Functions/Blips/CreateClientBlip
#19
I would love to see a release for all blips that belong on the radar, Hopefully looking correct, Not distorted etc.

As well an example script or however it's done to place a blip on the radar with this release
#20
I have uploaded an example script of how to operate pickups due to weapon pickup issues, Not being able to remove and re-spawn etc.
"The original methods for pickups are nasty, This method is better ;)"

In this script you will also notice an example of running other time intervals off of one 'NewTimer'.

You Do NOT need many timers for loops only one. This loop example is highly expandable when modifying the time intervals.

Disclaimer: I can not be held accountable for you running bad coding in these timed loops

Quote from: KAKAN on Jul 17, 2016, 01:58 PMDon't use many pickups at a place, it will turn your server into shit.

The pickups in the server were only used as an example, They wont give you armour etc, There only examples.

You will need to convert your weapons from xml to CreateWeaponPickups(model, x, y, z)
Don't forget to remove the time prints "Added for noobs"

Enjoy the first ever pickup removal script ;)

/* Weapon Script */

#Motley
#10/30/16
#Note-pad++

max_weapons <- 2000;

weapon_pos_x <- array(max_weapons, 0);
weapon_pos_y <- array(max_weapons, 0);
weapon_pos_z <- array(max_weapons, 0);

weapon_picked <- array(max_weapons, false);

pickuped_weapon <- array(max_weapons, 0);
weapon_time <- array(max_weapons, 0);

Minutes <- 0;
Seconds <- 0;
Hours <- 0;

function onScriptLoad()
{
    CreateWeaponPickups( 274, 368.053, 1050.34, 19.213) // PISTOL
    CreateWeaponPickups( 283, 365.96, 1050.13, 19.213) // UZI
    CreateWeaponPickups( 277, 363.171, 1050.22, 19.213) // SHOTGUN
    CreateWeaponPickups( 366, 385.615, 1210.76, 19.4767) // HEALTH
    CreateWeaponPickups( 366, 468.686, 695.558, 12.1433) // HEALTH
    CreateWeaponPickups( 262, 407.347, -487.586, 12.3432) // BASEBALL BAT
    CreateWeaponPickups( 368, 385.499, -469.809, 12.3432) // ARMOUR
   
    NewTimer("Loop_Seconds", 1000, 0);
}

// Our server loop
function Loop_Seconds()
{
  //pickup-system
  for (local i=0;i<max_weapons;i++)
  {
    //pickup-time
    if (weapon_picked[i] == true)
    {
      if (weapon_time[i] > 0)
      {
         weapon_time[i]--;
         if (weapon_time[i] == 0)
         {
            // Create the pickup
            CreateWeaponPickups(pickuped_weapon[i], weapon_pos_x[i], weapon_pos_y[i], weapon_pos_z[i]);

            // Clear the arrays
            pickuped_weapon[i] = 0;
            weapon_pos_x[i] = 0;
            weapon_pos_y[i] = 0;
            weapon_pos_z[i] = 0;
            weapon_time[i] = 0;
            // Clear the arrays
         }
      }           
    }
    //pickup-time
  }
  //pickup-system
   
   //time durrations
   if ( Seconds == 60 )
   {
           Seconds = 0;
           Minutes++;

           Loop_Minutes();
   }

   if ( Minutes == 60 )
   {

           Minutes = 0;
           Hours++;

           Loop_Hours();
   }

   Seconds++;
   print("Seconds " +  Seconds);
   //time durrations
}

// Our seconds loop
function Loop_Minutes()
{
     print("Minutes " +  Minutes);
}

// Our minute loop
function Loop_Hours()
{
     print("Hours " +  Hours);
}


function CreateWeaponPickups(model, x, y, z) {
  local g_pickup = CreatePickup(model, Vector(x, y, z));
 
  weapon_picked[g_pickup.ID] = false;
   
  return g_pickup; 
}

function onPickupPickedUp(player, pickup) {
 
  local model = pickup.Model;
   
  switch (model)
  {

   /* PISTOL */
case 274:
      pickup.Remove();
      pickuped_weapon[pickup.ID] = model;
      weapon_pos_x[pickup.ID] = pickup.Pos.x;
      weapon_pos_y[pickup.ID] = pickup.Pos.y;
      weapon_pos_z[pickup.ID] = pickup.Pos.z;
      weapon_time[pickup.ID] = 30;
      print(pickuped_weapon[pickup.ID]);
      break;
   /* UZI */
case 283:
      pickup.Remove();
      pickuped_weapon[pickup.ID] = model;
      weapon_pos_x[pickup.ID] = pickup.Pos.x;
      weapon_pos_y[pickup.ID] = pickup.Pos.y;
      weapon_pos_z[pickup.ID] = pickup.Pos.z;
      weapon_time[pickup.ID] = 30;
      break;
   /* SHOTGUN */
case 277:
      pickup.Remove();
      pickuped_weapon[pickup.ID] = model;
      weapon_pos_x[pickup.ID] = pickup.Pos.x;
      weapon_pos_y[pickup.ID] = pickup.Pos.y;
      weapon_pos_z[pickup.ID] = pickup.Pos.z;
      weapon_time[pickup.ID] = 30;
      break;
   /* HEALTH */
case 366:
      pickup.Remove();
      pickuped_weapon[pickup.ID] = model;
      weapon_pos_x[pickup.ID] = pickup.Pos.x;
      weapon_pos_y[pickup.ID] = pickup.Pos.y;
      weapon_pos_z[pickup.ID] = pickup.Pos.z;
      weapon_time[pickup.ID] = 30;
      break;
   /* BASEBALL BAT */
case 262:
      pickup.Remove();
      pickuped_weapon[pickup.ID] = model;
      weapon_pos_x[pickup.ID] = pickup.Pos.x;
      weapon_pos_y[pickup.ID] = pickup.Pos.y;
      weapon_pos_z[pickup.ID] = pickup.Pos.z;
      weapon_time[pickup.ID] = 30;
      break;
   /* ARMOUR */
   case 368:
      pickup.Remove();
      pickuped_weapon[pickup.ID] = model;
      weapon_pos_x[pickup.ID] = pickup.Pos.x;
      weapon_pos_y[pickup.ID] = pickup.Pos.y;
      weapon_pos_z[pickup.ID] = pickup.Pos.z;
      weapon_time[pickup.ID] = 30;
      break;
  }
 
  weapon_picked[pickup.ID] = true;
   
  return true;
}