22.05.2019, 01:43
Dual Gaming - Tutorial #1
Introduction
Mapping your objects
Mapping in SA-MP is quite easy, in my point of view. It simply needs patience, dedication and time. Some persons tend to become annoyed when they're mapping, and when things aren't going their way, they flip off. Trust me, it happens to me sometimes. You may map an object in a map editor, but after adding it to the gamemode or filterscript and testing it on the server, it doesn't give the output you expected. What I want you to do is take a deep breath, and aim towards fixing it, as if you've never had difficulties while mapping it.I personally recommend two map editor softwares. They are:
- SA-MP Map Editor - Click here to download/view it (More preferable)
- MTA (Multi Theft Auto) Map Editor - Click here to download/view this extension
Differences:
- CreateDynamicObjectEx - allows you to change the draw distance (how many objects a player can see from their distance) and show the object for various worlds, interiors or players.
- CreateDynamicObject - has no settings to allow players to view objects from a far distance (streaming many at one time) and such objects can only be seen in one world or interior.
- CreateObject - is default. However, it only limits you to a certain amount of objects (which can be seen here: https://sampwiki.blast.hk/wiki/Limits)
- RemoveBuildingForPlayer - this removes the buildings and objects for players.
Differentiation and Specific Usages
If you're adding the mapped object codes to your .pwn gamemode file, found in the gamemode folder, place the codes under:PHP Code:
public OnGameModeInit()
{
// Place the Codes here
return 1;
}
PHP Code:
public OnFilterScriptInit()
{
// Place the Codes here
return 1;
}
PHP Code:
public OnPlayerRequestClass(playerid, classid)
{
// Codes
return 1;
}
PHP Code:
public OnPlayerConnect(playerid)
{
// Codes
return 1;
}
Tip: You must add the streamer include to your pawno/includes folder (which can be found here: GitHub Releases).
How to add it to your .pwn gamemode file after placing it in the include folder? Look below (add it below #include <a_samp>[At the top of the script])
PHP Code:
#include <streamer>
Good luck, and if you have comments/remarks, feel free to share them below. I might make tutorials of how to create certain stuff, like faction-related scripts, attaching items/objects to players/vehicles, creating login/register dialogs, how to built master-account scripts (which allows you to create a main account, and create characters afterwards in-game (step-by-step), and some other stuff!