Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Dhrubo on May 30, 2016, 06:22 AM

Title: How To Script
Post by: Dhrubo on May 30, 2016, 06:22 AM
Hello I wanna script a server so, I need details. How can I script a server?
Title: Re: How To Script
Post by: Murdock on May 30, 2016, 08:15 AM
You should consider some programming courses first, I wouldn't recommend starting with a non-typesafe language
Title: Re: How To Script
Post by: . on May 30, 2016, 08:19 AM
Quote from: Murdock on May 30, 2016, 08:15 AMYou should consider some programming courses first, I wouldn't recommend starting with a non-typesafe language

F* your basics man. I wanna code 8)
Title: Re: How To Script
Post by: vito on May 30, 2016, 08:21 AM
download - http://forum.vc-mp.org/?topic=33.0

then edit main.nut file using something from:
http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Functions
http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Events
Quote from: Murdock on May 30, 2016, 08:15 AMYou should consider some programming courses first, I wouldn't recommend starting with a non-typesafe language
Yes. If you new in coding - better to start from javascript. It's very tolerant for newbies.
Title: Re: How To Script
Post by: Dhrubo on May 30, 2016, 09:25 AM
Thanks for that, but I don't know how to add it copy paste? I tried that but didn't worked.
Title: Re: How To Script
Post by: Stormeus on May 30, 2016, 04:40 PM
Quote from: Dhrubo on May 30, 2016, 09:25 AMI don't know how to add it copy paste?

Literally nothing good has been developed by blindly copying and pasting from other people. Learn how to actually script on your own first.
Title: Re: How To Script
Post by: Dhrubo on May 31, 2016, 08:11 AM
But how could I learn how to script a server. A time WiLsOn told me that delete system 32. So, I asked what to do then but he didn't wanted to answer me.
Title: Re: How To Script
Post by: KAKAN on May 31, 2016, 11:27 AM
But why is the topic located in "Tutorials" section?
Title: Re: How To Script
Post by: Dhrubo on May 31, 2016, 11:57 AM
I don't know but I think it's tutorial that I wanna know.
Title: Re: How To Script
Post by: . on May 31, 2016, 12:02 PM
To be honest, I encounter this question on a weekly basis. And my answer (and advice) is always the same: Anyone asking questions like "how do I code?" will never end up a programmer. And will never end up writing more than 2 lines of code that aren't either copied from someone else or broken as hell. You don't see a lion be like "how do I hunt?" or a bird "how do I fly?". They just know. Programmers have the curiosity, persistence and ambition to learn all by themselves.

Programming involves a lot of self documentation. About 50% of the time you document yourself. And if you can't figure out on your own how to start programming then how will you be able to search when you need to know or learn something. At what point it started to be alright to start programming when you can't even search something?

Programming is not something you learn overnight or over the course of a week. It's not like learning to ride a bicycle. It takes years of constant learning and practice. So just try to understand your current position before you decide you want to achieve something.

I'm not trying to discourage you. I'm just trying to make sure you know what to expect and not get your hopes up only to be disappointed later when you realize the truth.
Title: Re: How To Script
Post by: aXXo on May 31, 2016, 05:21 PM
Quote from: Dhrubo on May 31, 2016, 08:11 AMA time WiLsOn told me that delete system32.
:-X
Title: Re: How To Script
Post by: Dhrubo on Jun 03, 2016, 12:15 PM
/ban worked bye copy pasting but /unbanip not worked.
Title: Re: How To Script
Post by: KAKAN on Jun 03, 2016, 12:34 PM
$h0W C0DE( show your code )
Title: Re: How To Script
Post by: Dhrubo on Jun 03, 2016, 03:38 PM
Thanks for all replies now I have learned that how to script :) so no need to help me I am scripting now. Hmm KAKAN wait showing my code:
function onPlayerCommand( player, cmd, text )
{
   if (cmd == "unbanip")
   {
      if(!IsIPBanned(text) == true)
      {
         ClientMessage("Provided IP '" + text + "' was not banned previously",player,255,255,255);
      }
      else
      {
         UnbanIP(text);
         ClientMessage("Unbanned IP: " + text,player,255,255,255);
      }
   }
}
Title: Re: How To Script
Post by: EK.IceFlake on Jun 04, 2016, 03:46 AM
No null checking on text, risk of crash.
No administrative check, risk of abuse.
Try to fix these two
And post your UnbanIP because that is the core of your unban command.
Title: Re: How To Script
Post by: Dhrubo on Jun 04, 2016, 07:57 AM
How to fix it? And some commands are not working when I paste check point events or something.
Title: Re: How To Script
Post by: KAKAN on Jun 04, 2016, 08:44 AM
checkpoints are buggy shit, we won't blame you for that :P
Title: Re: How To Script
Post by: Dhrubo on Jun 04, 2016, 12:10 PM
Hmm, ok
Title: Re: How To Script
Post by: Coolkid on Jun 05, 2016, 04:42 PM
Have u learnt to script or copy paste lol
Title: Re: How To Script
Post by: Dhrubo on Jun 06, 2016, 12:56 PM
Copy paste only.
Title: Re: How To Script
Post by: MatheuS on Jun 06, 2016, 01:11 PM
(https://media.giphy.com/media/3o6gb6FDk0QR7Et04g/giphy.gif)
Title: Re: How To Script
Post by: Dhrubo on Jun 08, 2016, 01:33 PM
Copy pasting but I want to script not editing...
Title: Re: How To Script
Post by: jayant on Jun 08, 2016, 04:46 PM
So, why not download a released script from the forum and try to understand whats in them..To understand more you can use the forum, vcmp wiki and squirrel manual.
Title: Re: How To Script
Post by: Dhrubo on Jun 09, 2016, 05:26 AM
No, I don't want a released script..I want to make a script but how can I make it?
Title: Re: How To Script
Post by: Xmair on Jun 09, 2016, 05:33 AM
Quote from: Dhrubo on Jun 09, 2016, 05:26 AMNo, I don't want a released script..I want to make a script but how can I make it?
You should ask this question to your brain instead of asking it to us.
Title: Re: How To Script
Post by: KAKAN on Jun 09, 2016, 07:10 AM
Quote from: Dhrubo on Jun 09, 2016, 05:26 AMNo, I don't want a released script..I want to make a script but how can I make it?
Quote from: Murdock on May 30, 2016, 08:15 AMYou should consider some programming courses first, I wouldn't recommend starting with a non-typesafe language
Title: Re: How To Script
Post by: Dhrubo on Jun 14, 2016, 12:35 PM
Quote from: jayant on Jun 08, 2016, 04:46 PMSo, why not download a released script from the forum and try to understand whats in them..To understand more you can use the forum, vcmp wiki and squirrel manual.
Nice but I tried DMS script if I kill I get no money so I wanted to use ADM script but it shows MSVCR71.dll not found.