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 - MaTaDeToR

#46
Quote from: Mr_Motley on Mar 13, 2016, 12:30 PMTested and the code still works the same.
I have thought about using custom colors on spawning, I prefer to not use custom colors as when I script in Pay and sprays, The garages will have less meaning to them..

I can not seem to figure out to why this is like this. But if it is not Fixable for some reason I will keep it this way to help others in the server to want to use pay n spray,
If anyone plays it :P
Well, so you mean this isn't the case? you don't want it to be changed to many colors automatically right? but you can't also figure out how automatically your Veh is changing color, so meh! if i'm going right, you should search, for "Color1" in your whole script then if that's the case..... or not am I wrong ?
#47
Quote from: rwwpl on Mar 13, 2016, 09:05 AM
Quote from: Kusanagi on Mar 13, 2016, 08:31 AMyou can use rand()%96 for random colour like player.Vehicle.Colour1 = (rand()%96);
player.Vehicle.Colour2 = (rand()%96);
here is something that you may like http://forum.vc-mp.org/?topic=409.msg2613#msg2613

http://wiki.vc-mp.org/wiki/Car_Colors

max 94, not 96

Quote from: Mr_Motley on Mar 13, 2016, 07:35 AMThere is a timer that runs checks on your Vehicle and when you exit the vehicle it will decrease the time.

Not a lot of timers Only a Minute timer and a Seconds timer that starts on scriptload. and i use those two to run anything i need either if it is minutes or seconds. Mute etc

I may of messed up the code a little as I have been playing with it a lot(A LOT!!!!!!)
But Tested and still seems fine..
  if (cmd == "vehicle" || cmd == "v" || cmd == "spawncar" || cmd == "car") {
    if (!text) {
       MessagePlayer("Vehicle: /vehicle [130-236]", player);
       return true;
    }
   
    if (!IsNum(text)) {
       MessagePlayer("Vehicle: /vehicle [130-256]", player);
       return true;
    }
 
    local model = text.tointeger();
   
    if (model < 130 || model > 236) {
       MessagePlayer("Vehicle: /vehicle [130-236]", player);
       return true;
    }
   
    if (used_vehicle[player.ID] > 0 && Admin[player.ID] < 1) {
      MessagePlayer("You may spawn your Vehicle in"+Time(used_vehicle[player.ID])+" min", player);
      return true;   
    }
   
    if (!VehicleID(model) && Admin[player.ID] < 2) {
      MessagePlayer("You can't spawn this vehicle", player);
      return true;
    }
   
    if (player.Vehicle) {
       MessagePlayer("Must not be in a vehicle", player);
       return true;
    }
     
    if (Player_Vehicle[player.ID] > 0) {
      local vehicle = FindVehicle(Player_Vehicle[player.ID]);
      if (vehicle) {
        vehicle.Remove();
      }
     
      Player_Vehicle[player.ID];
    } 
         
local vehicle = CreateVehicle(model, player.Pos, player.Angle, -1, -1);
    if (vehicle) {
      Player_vehicle[player.ID] = vehicle.ID;
      MessagePlayer("Vehicle spawned: " + model, player);
      player.Vehicle = vehicle;
      used_vehicle[player.ID] = 30;
    }

    return true;
  }

This isn't LU. Here you can't use -1 (random color from carcols.dat) color in CreateVehicle.
Quote from: Mr_Motley on Mar 13, 2016, 07:35 AMThere is a timer that runs checks on your Vehicle and when you exit the vehicle it will decrease the time.

Not a lot of timers Only a Minute timer and a Seconds timer that starts on scriptload. and i use those two to run anything i need either if it is minutes or seconds. Mute etc

I may of messed up the code a little as I have been playing with it a lot(A LOT!!!!!!)
But Tested and still seems fine..
  if (cmd == "vehicle" || cmd == "v" || cmd == "spawncar" || cmd == "car") {
    if (!text) {
       MessagePlayer("Vehicle: /vehicle [130-236]", player);
       return true;
    }
   
    if (!IsNum(text)) {
       MessagePlayer("Vehicle: /vehicle [130-256]", player);
       return true;
    }
 
    local model = text.tointeger();
   
    if (model < 130 || model > 236) {
       MessagePlayer("Vehicle: /vehicle [130-236]", player);
       return true;
    }
   
    if (used_vehicle[player.ID] > 0 && Admin[player.ID] < 1) {
      MessagePlayer("You may spawn your Vehicle in"+Time(used_vehicle[player.ID])+" min", player);
      return true;   
    }
   
    if (!VehicleID(model) && Admin[player.ID] < 2) {
      MessagePlayer("You can't spawn this vehicle", player);
      return true;
    }
   
    if (player.Vehicle) {
       MessagePlayer("Must not be in a vehicle", player);
       return true;
    }
     
    if (Player_Vehicle[player.ID] > 0) {
      local vehicle = FindVehicle(Player_Vehicle[player.ID]);
      if (vehicle) {
        vehicle.Remove();
      }
     
      Player_Vehicle[player.ID];
    } 
         
local vehicle = CreateVehicle(model, player.Pos, player.Angle, -1, -1);
    if (vehicle) {
      Player_vehicle[player.ID] = vehicle.ID;
      MessagePlayer("Vehicle spawned: " + model, player);
      player.Vehicle = vehicle;
      used_vehicle[player.ID] = 30;
    }

    return true;
  }
Alright as pointing rwwpl, I'd also like to say that if you want to have Random colors, so use the Famous function rand(); however, -1 doesn't work here, for :| Random colors. The Example with command has been mentioned above, but would like to tell again if you didn't notice......
if ( cmd =="createveh")
{  // Admin system if you do have......
 if ( text)
    {
   if ( IsNum(text) )
        {
         local Vehicle_Model = text.tointeger();
          if ( Vehicle_Model.tointeger() > 130 && Vehicle_Model.tointeger() < 236 )
                  {
                    if ( !player.Vehicle )
                           {
                             ClientMessage("You have Created a Vehicle with Random Colors",player,255,255,0);
                             CreateVehicle ( Vehicle_Model.tointeger(), player.World, player.Pos, player.Angle, rand() % 94,rand() % 94);
                                 }
                             else ClientMessage("You don't have to be in the Vehicle",player,255,255,0);
                             }
                     else ClientMessage("ID Should be Between 130-256",player,255,255,0);
               }
          else ClientMessage("Syntax : /" + cmd + " <130-256>",player,255,255,0);
         }
     else ClientMessage("/" + cmd + " <130-256>",player,255,255,0);
 }
#48
Quote from: Doom_Kill3R on Mar 13, 2016, 08:38 AMlocal vehicle = CreateVehicle(model, player.Pos, player.Angle, rand() % 17, rand() % 17);
I guess, i've been mistaken, I thought he doesn't want Random colors o.0?
EDIT : If he do want's Random Colors
if ( cmd =="createveh")
{  // Admin system if you do have......
 if ( text)
    {
   if ( IsNum(text) )
        {
         local Vehicle_Model = text.tointeger();
          if ( Vehicle_Model.tointeger() > 130 && Vehicle_Model.tointeger() < 236 )
                  {
                    if ( !player.Vehicle )
                           {
                             ClientMessage("You have Created a Vehicle with Random Colors",player,255,255,0);
                             CreateVehicle ( Vehicle_Model.tointeger(), player.World, player.Pos, player.Angle, rand() % 94,rand() % 94);
                                 }
                             else ClientMessage("You don't have to be in the Vehicle",player,255,255,0);
                             }
                     else ClientMessage("ID Should be Between 130-256",player,255,255,0);
               }
          else ClientMessage("Syntax : /" + cmd + " <130-256>",player,255,255,0);
         }
     else ClientMessage("/" + cmd + " <130-256>",player,255,255,0);
 }
#49
Quote from: Mr_Motley on Mar 13, 2016, 07:35 AMThere is a timer that runs checks on your Vehicle and when you exit the vehicle it will decrease the time.

Not a lot of timers Only a Minute timer and a Seconds timer that starts on scriptload. and i use those two to run anything i need either if it is minutes or seconds. Mute etc

I may of messed up the code a little as I have been playing with it a lot(A LOT!!!!!!)
But Tested and still seems fine..
  if (cmd == "vehicle" || cmd == "v" || cmd == "spawncar" || cmd == "car") {
    if (!text) {
       MessagePlayer("Vehicle: /vehicle [130-236]", player);
       return true;
    }
   
    if (!IsNum(text)) {
       MessagePlayer("Vehicle: /vehicle [130-256]", player);
       return true;
    }
 
    local model = text.tointeger();
   
    if (model < 130 || model > 236) {
       MessagePlayer("Vehicle: /vehicle [130-236]", player);
       return true;
    }
   
    if (used_vehicle[player.ID] > 0 && Admin[player.ID] < 1) {
      MessagePlayer("You may spawn your Vehicle in"+Time(used_vehicle[player.ID])+" min", player);
      return true;   
    }
   
    if (!VehicleID(model) && Admin[player.ID] < 2) {
      MessagePlayer("You can't spawn this vehicle", player);
      return true;
    }
   
    if (player.Vehicle) {
       MessagePlayer("Must not be in a vehicle", player);
       return true;
    }
     
    if (Player_Vehicle[player.ID] > 0) {
      local vehicle = FindVehicle(Player_Vehicle[player.ID]);
      if (vehicle) {
        vehicle.Remove();
      }
     
      Player_Vehicle[player.ID];
    } 
         
local vehicle = CreateVehicle(model, player.Pos, player.Angle, -1, -1);
    if (vehicle) {
      Player_vehicle[player.ID] = vehicle.ID;
      MessagePlayer("Vehicle spawned: " + model, player);
      player.Vehicle = vehicle;
      used_vehicle[player.ID] = 30;
    }

    return true;
  }
Change this Line to local vehicle = CreateVehicle(model, player.Pos, player.Angle, -1, -1); to this local vehicle = CreateVehicle(model, player.Pos, player.Angle, 1, 1); and tell me, if it works. since -1 isn't used in VC-MP, for this kind of stuff.
#50
Well First I would like to give you an Example......
if ( cmd =="color") { local veh = player.Vehicle; if ( veh ) { ClientMessage("Your car color has been changed",player,255,255,0); veh.Color1 =1; veh.Color2 = 5;  } else ClientMessage(" you need to be inside a Vehicle",player,255,255,0);}Explanation : you have to define your particular vehicle in which you are sitting, and Vehicle.Color1-2 are functions in the Wiki.....to change Vehicle colors...
..you could get Vehicle colors from here.
You can also add it through the Class <Vehicle model="" x="" y="" z="" angle="" col1="0" col2="0 "/>Point : Can you show us the Function by which you are creating the Vehicles, if any? like Commands etc. Also make sure you aren't using any timer in the Vehicle Move event, or in command to change your! particular Vehicle color.....
P.S : Kindly reply.....
#51
Support / Re: [Server] Port Forward
Mar 11, 2016, 03:54 PM
Quote from: Drake on Mar 11, 2016, 01:22 PMSo that means it's my router which isn't port forwarding due to some reason?
@Drake Make your Protocol UDP and make sure that you have allowed your "server32" || "server64" etc from the Fire-wall, and delete the rubbish from the Port Forwarding Area( it might be a cause if you have any). i.e
P.S : Also allow your LAN Loopback( if have ).
Additional : You can open Command Prompt and type /ipconfig to set up the IP in your Router( The IP should be IPv4 Autoconfig ). Sure I do know you have set the things correct, but still if it might help you.

#52
Scripting and Server Management / Re: Urgent
Mar 11, 2016, 01:35 PM
Quote from: Dangerous on Mar 11, 2016, 01:11 PMHello guys, i need urgent help!!! How can i find x pos, y pos, z pos, angle, cam pos, cam look, world boundaries, col1, col2 etc. of a thing??? I m a learner now!!! I don't know many things!!! Please guys help me!!! :-X
Why don't you use the Wiki there are many example of these all stuff over Their!. I'd, also like to give you a command as a example how to get these following as looking your curiosity.....
//Command Event over here
if ( cmd =="test") {
ClientMessage("Player Pos X " + player.Pos.x + ", " player.Pos Y " + player Pos.y + ", player Pos Z " + player.Pos.z + ", Angle : " + player.Angle + ".......",player,255,255,0);}
So as mention above you should also learn the squirrel documentary. That's all I could do, for you, because, I could barely Understand you. You Could also find the color, and all other ids stuff from the Wiki.
P.S : You could also download the following Snippets, and Scripts being released in the Forum.
#53
Applications / [APP]Server-Host.
Mar 11, 2016, 10:43 AM
First Name: MaTaDeToR
Last Name: Blaz
Email Address: [email protected]
Server Name:[0.4] Cops V/s Criminal City
Port:6192
Slots(10-100):50.