View Full Version : Tutorials and Packages
TommyGun
10-02-2012, 06:14 PM
Hello, all.
I'm considering starting development for a VaultMP server and I will organise hosting myself.
Just wondering one thing, as the Pawn is slightly different to SA:MP, I want to know if there's any tutorials for the regular features such as OnPlayerConnect, but I need to know how to use these functions. Also, I was wondering if there was a package for servers and a tutorial such as a Pawn server package which includes folders like SA:MP Script Package such as it comes with Pawno and all the folders you need, and also includes the VaultMP client.
All the best,
TommyGun
foxtacles
10-02-2012, 06:18 PM
Some documentation for callbacks and functions is available here:
https://www.vaultmp.com/showwiki.php?title=Category:Scripting+callbacks
https://www.vaultmp.com/showwiki.php?title=Category:Scripting+functions
The server package on the Download page includes everything you need (pawncc.exe - compiler, standard.pwn - default example script). Note that you need to compile with -C64 option (see compile.bat). There is no editor, but I guess you can use Pawno from SA-MP without problems (if you just replace includes and the compiler with the vaultmp ones).
TommyGun
10-02-2012, 10:11 PM
I have to install Fallout 3 on my laptop as I got a new laptop, so do I need Fallout 3 to make a start on my script?
foxtacles
10-02-2012, 10:45 PM
No, but for testing in-game it's probably useful.
TommyGun
10-02-2012, 10:48 PM
Clearly, so on the downloads, I guess I click both Client and Server? Also, what exactly is a master server? And do I just extract the files to my Fallout 3 directory?
foxtacles
10-02-2012, 10:49 PM
https://www.vaultmp.com/showwiki.php?title=How+to+set+up+the+server+and+co nnect
TommyGun
10-02-2012, 10:52 PM
Sorry for all the questions and replies, but it seems most of the callbacks, functions, constants and types tutorials are C/C++ and I was wondering if you have a Pawn version, mainly so I can understand constants inside VaultMP script.
foxtacles
10-02-2012, 11:51 PM
Except for a few cases, the PAWN interface is identical to the C/C++ one. If you have any specific question regarding something, I'll be happy to help.
https://www.vaultmp.com/showwiki.php?title=GetName
The pages show the declaration (both C and PAWN) and explain the parameters. The parameters are listed with leading C type. PAWN has no such types*, but it should be straightforward how to use them if you have a basic understanding of the language. If the PAWN signature is different, it is documented.
(note that "Code c" boxes may refer to PAWN content (cause there is no PAWN highlighting), which should be easily identified by looking at the syntax)
*not entirely true, as I defined some constant types, but I documented them as well
TommyGun
10-03-2012, 04:24 PM
Hmm, seeing as I'm fairly new to all the technical side of Pawn, new name{MAX_PLAYER_NAME}; clearly makes a new string called "name" but I don't understand the parameters inside GetName(player, name);...
The GetName bit is clear, but the player bit - is this the player you are receiving the name from? And the name bit, what exactly is this? Sorry, I'm not exactly a beginner I just don't understand the VaultMP interpretation of Pawn.
foxtacles
10-03-2012, 04:36 PM
It's pretty much the same as the SA-MP function:
https://wiki.sa-mp.com/wiki/GetPlayerName
First parameter is the ID (which you have in callbacks), second is the storage. vaultmp uses packed strings and has no len parameter. That's the only difference.
TommyGun
10-03-2012, 05:03 PM
I understand now, but there are a lot of things I am still confused about as the tutorials show only C and C++ which I don't even know anything about. Such as DEFAULT_PLAYER_RESPAWN and SetRespawn. Where do I place these in my Pawn script?
foxtacles
10-03-2012, 05:17 PM
Where is the "tutorial" that only shows C/C++? It's just documentation of functions. You place calls inside callbacks or functions you wrote yourself. Sorry, but I really see no difficult thing about it. It's no different than i.e. SA-MP except for a different set of functions and callbacks.
DEFAULT_PLAYER_RESPAWN is a constant. SetRespawn is a function. Place and use them whereever you think it's appropriate in your script. There is no such thing as "where to place in a script". This is programming. Check the example standard.pwn script or code snippets like https://www.vaultmp.com/showwiki.php?title=NukaScript+Fallout+3 - I can't help more than that.
TommyGun
10-03-2012, 05:20 PM
Yes but when I want to define the DEFAULT_PLAYER_RESPAWN where do I insert this inside my Pawn script... such as main() or what?
foxtacles
10-03-2012, 05:22 PM
It is defined: https://github.com/Foxtacles/vaultmp/blob/master/source/vaultscript/pawnc/include/vaultmp.inc
I don't think you have a basic understanding of the language (and using it), else it should be the most native thing on earth for you to recognize.
TommyGun
10-03-2012, 05:25 PM
Ah, I see. But, what if I wanted to make the respawn time different, would I use SetRespawn?
foxtacles
10-03-2012, 05:27 PM
Yes...just read that documentation...
https://www.vaultmp.com/showwiki.php?title=SetRespawn
TommyGun
10-03-2012, 05:47 PM
Mate, I understand how to script SA:MP servers, it's just you have no callback for OnPlayerDeath or anything like that, so I don't fully understand where I put SetRespawn? Does this go inside the main(), and if so the syntax seems to be incorrect.
#include <vaultmp>
main()
{
printf("The Wasteland Roleplay \n Owners: TommyGun and Monster");
SetServerName("The Wasteland Roleplay");
SetServerRule("website", "www.forums.empire-bay.com");
SetServerRule("game", "Fallout 3");
SetServerRule("mode", "Roleplay/TDM");
SetServerMap("The Capital Wasteland");
}
I inserted 'SetRespawn(120000);' into the bottom of my main() code and it didn't compile...
foxtacles
10-03-2012, 05:52 PM
A Player is an Actor, therefore all actor callbacks are getting called for players as well. OnActorDeath.
https://www.vaultmp.com/showwiki.php?title=Category:Scripting+callbacks
I inserted 'SetRespawn(120000);' into the bottom of my main() code and it didn't compile...
Then you are doing something wrong, because it does work.
TommyGun
10-03-2012, 07:19 PM
Oh, I see, I thought 'OnActorDeath' was simply for NPCs.
TommyGun
10-03-2012, 08:18 PM
Another stupid fucking question:
How do you create commands?
This seems to be my hotspot within SA:MP scripting, so I'd like to know.
foxtacles
10-03-2012, 08:47 PM
https://www.vaultmp.com/showwiki.php?title=Command+processor
TommyGun
10-03-2012, 09:16 PM
That's nice, is the C version Pawn-compatible?
foxtacles
10-03-2012, 09:28 PM
(note that "Code c" boxes may refer to PAWN content (cause there is no PAWN highlighting), which should be easily identified by looking at the syntax)
...can't you even recognize PAWN syntax or at least read my posts
Powered by vBulletin® Version 4.2.1 Copyright © 2023 vBulletin Solutions, Inc. All rights reserved.