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

Messages - Mötley

#31
General Discussion / Re: car shade
Sep 30, 2018, 04:44 AM
Neon lights underneath? Probably could ask developers to add a method to change the cars shadow color and possibly the intensity of the shadow.

By modifying vehicle shadows you practically got neon lights, slightly buggy if airborne possibly, or swap out the shadow with a corona from weapon pickups
#32
Quote from: GooDNewS on Sep 28, 2018, 05:44 PMNowadays every single retarded teenager creating his own discord "server" to have powership over others somewhere.

It's mostly to bring the community together and to help build each other up. As stated:
Hate towards any member will not be tolerated and will result in a permanent ban regardless as to who you are.

This was setup with great intensions! :)
#33
That server is for just scripters and some of them hate upon members and talk down upon them, I highly suggest not joining that discord D:
#34
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
#35
You could probably do this on

onPlayerHeathChange
function onPlayerHealthChange( player, lastHP, newHP ) {
     if ( lastHP > newHP ) {
       if ( player.Pos.z <= GetWaterLevel() ) {
          local vehicle = CreateVehicle( 136, player.Pos, player.Angle, 1, 2);
          player.Vehicle = vehicle;
          return true;
       }
     }
}
This was scripted at random, and with just thoughts, not tested
#36
Snippet Showroom / Re: Use cmds with "!"
Feb 03, 2018, 01:19 PM
This still does not mean the players would still attempt to use !login (password)

Should add something like this to the code as not every scripter/player is bright

g_CommandNames <- [ "login", "register", "blah", "blahblah" ];

    foreach ( name in g_CommandNames )
    {
        if ( name == params[ 0 ] )
        {
            MessagePlayer( "This is a private command", player );
            return;
        }
    }

Also wouldn't return 0 make this no longer a public command script?
#37
Snippet Showroom / Re: Use cmds with "!"
Feb 02, 2018, 07:57 PM
Maybe the script should use a separate command other than onPlayerCommand, as some players are weird..

Lol: !login (password)

Just saying

I would just add an array of strings that are commands, if that string exist, don't output the command and notify the player


Sorry I'm on my phone at the moment
#38
Quote from: Doom_Kill3R on Feb 01, 2018, 10:26 AMWhat's so hard when I already told you the method

xD all I said was

Quote from: TurboGrafx on Jan 29, 2018, 02:10 AMI did a search for that version. I did not see it, Can I get a link please :)?

So I was still at ???.



But thanks I guess :)
#39
Quote from: =RK=MarineForce on Jan 17, 2018, 10:23 AM" + GetSkinName( player.Skin ) + "

how to get vehicle name ?

" + GetVehicleName( player.Vehicle ) + "

        local vehicle = CreateVehicle( text, player.Pos, player.Angle, rand() % 99, rand() % 99);
        player.Vehicle = vehicle;
        MessagePlayer("Vehicle Spawned: " + GetVehicleNameFromModel( text ), player );

It's vehicle.Model
#40
Added a second fix, So Viceport goes all the way to the first island... And causes a lot of issues,

on GetPlayerIsland(player)
You might want to play with
         
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;
            }
         }
-500 seems to be okay, just drive on that main bridge, dont worry about being that close to the center on the map as that entire area is patched, everything else island etc works fine :).

Just fiddle with that line if anything ;)



If you want to test it, to prevent insanity just use this:

// Server Loop
Server_Timer <- null;

function Server_Loop() {
   
  local Players = GetPlayers();
  if (!Players) return; // Skip the loop

  for (local i=0;i<GetMaxPlayers();i++) {
    local player = FindPlayer(i);
   
    if (player) {
      if (player.ID == i) {

        GetNearestHospital(player)

        Announce("~b~Island~w~: ~r~ " + Player_Island[i] + " ~b~Loacation~w~: ~r~ " + Player_Locator[i], player, 1);
      }
    }
  }
}

function onScriptLoad() {
Server_Timer = NewTimer( "Server_Loop", 1000, 0 );
}

function onScriptUnload() {
local timer = Server_Timer;
    if ( timer ) {
      timer.Delete();
      Server_Timer = null;
    }
}
#41
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
#42
I did a search for that version. I did not see it, Can I get a link please :)?

Welp, I figured I would make this easier on myself, I made this Island return. It took a lot of testing. It's not 100% perfected but it should do the trick once perfected.

function GetIsland(pos) {
 
  // First Island
  if (pos.x > -170) return 1;
  // Third Island
  if (pos.x < -724) return 3;
 
  // Center islands bull shittery
  return 2;
}

function NearestHospital(pos) {
if (pos.y >= 30) return 1; // northern hospitals
if (pos.y <= 30) return 2; // southern hospitals

}



I'm just going to fix this myself and randomly put solved as I don't see anyone really helping on this tbh...
#43
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.
#44
You needed to remove plr.ID I think and replace it with i, Also did not see that @umar4911, I changed that error, kudos to that

   else if (  cmd == "adminchat" ) {
    if(pstats[ player.ID ].Level < 3 ) {
      MessagePlayer("[#FFDD33]Information:[#FFFFFF] Unauthorized Access", player);
      return true;
    }
    if(!text) {
      MessagePlayer("[#FF0000]Command Error:[#FFFFFF] Use /" + cmd + " [Message]", player);
      return true;
    }
    else {
      for (local i=0;i<GetMaxPlayers();i++) {
        if ( pstats[ i ].Level > 3) {
          local plr = FindPlayer(i);
       
          if (plr) {
            MessagePlayer("[#00ff00][Admin Chat] : [#00ffff] ("+playerName+"):  : [#FFFFFF]"+text, plr);
          }
        }
       }
    }
   }

Also you have playerName instead of player.Name?
#45
So are you using a database or ini?

Also there are more players hear.. I would run a check when saving a position. Get there Distance to the nearest saved vector. If distance is less than 3 or something let them know, tell them the name of the save, and don't save it.

Reason I say this is because I have watched players constantly type /saveloc. And thats all ;)