Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums



(Advanced Search)

Forum Statistics
» Members: 6,511
» Latest member: snaptrap
» Forum threads: 2,233
» Forum posts: 12,034

Full Statistics

Online Users
There are currently 650 online users.
» 0 Member(s) | 648 Guest(s)
Bing, Google

Latest Threads
I humor myself
Forum: Programming
Last Post: nami16504
Yesterday, 04:28 PM
» Replies: 5
» Views: 8,043
Command does not work in-...
Forum: Pawn Scripting
Last Post: PANZEHIR_
2024-11-23, 06:36 PM
» Replies: 0
» Views: 43
White Screen
Forum: Support
Last Post: Phat202146_real
2024-11-21, 02:50 PM
» Replies: 0
» Views: 43
I get error 021 using y_h...
Forum: Pawn Scripting
Last Post: daniscript18
2024-11-18, 11:34 PM
» Replies: 0
» Views: 61
Il reste des français sur...
Forum: French/Fran?ais
Last Post: tysanio
2024-11-18, 05:39 AM
» Replies: 2
» Views: 469
Object creation issues
Forum: Programming
Last Post: K1271
2024-11-15, 11:51 PM
» Replies: 0
» Views: 56
Is the SAMP Hosting the s...
Forum: General Discussions
Last Post: OperaGX
2024-11-14, 09:33 PM
» Replies: 0
» Views: 76
Run time error 19: "File ...
Forum: Pawn Scripting
Last Post: Rexey
2024-11-14, 03:50 AM
» Replies: 0
» Views: 65
How to Compile Your Gamem...
Forum: Tutorials
Last Post: thelante
2024-11-13, 08:50 AM
» Replies: 3
» Views: 477
Modeller wanted
Forum: Development Updates
Last Post: acc.gangbeni
2024-11-11, 05:10 PM
» Replies: 9
» Views: 16,518

 
  Favorites
Posted by: SynTacs - 2020-02-26, 01:25 AM - Forum: Chat - Replies (2)

It's been silent lately and it's kinda like we are dying in here and so hopefully with all your cooperation let's have fun answering my questions, it's not many just a couple but please. Don't keep your answers to a minimum of a sentence, feel the question and make sure that you answer it to an utmost level. :D



1. Let's talk about the server you liked the most? Which one and why?(There will be no list since everyone has a preferred server within the thousands that have been upped from the community)



2. Since the beginning of SA-MP life, recollect upon yourself of which times did you have fun? Had you had friends to enjoy all this and how did you enjoy yourselves?(I will not care if you did cheating, hacking and everything just tell the story. It's a story after all and anything you did goes. The important point is that YOU HAD FUN!)



3. Do you wish to make a repeat of that fun you had? Or do you wish to create new memories? Do you wish to meet the friends you've found in the old SA-MP?



4. Lastly, what do you wish to see in the future?(Make this as detailed as possible, this is literally just for future prospects, creators or server owners to see. Some might add what they read here and some might not)



Quote:

You may delete this part



Note: I hope you have take your time thinking your answers through.

Note 2: Thank you for taking the time to answer this questions. :D


  RogueDrifterZ source code (SQLITE)
Posted by: RogueDrifter - 2020-02-19, 04:00 PM - Forum: Gamemodes - No Replies

RogueDrifterZ





Gtihub: https://github.com/RogueDrifter/RogueDrifterZ-Drift



Installation





Simply install to your project:



Code:
sampctl package install RogueDrifter/RogueDrifterZ-Drift



Make sure to include all components and compile the Main file as the gamemode.







Story





You probably never heard of this, drifting in samp isn't that big, but this was an impact to my life and a few others.





Quote:RDZ is shutting down, the end to what me and @GoodBoii[RDZ] started back in 2015, and a special thanks to @WeirdASF (Eatmysmoke) the person who this server wouldn't have made it beyond 2017 due to his unlimited and by unlimited i mean the greatest ever help i ever had, the forums will always be up because its free to host, the online host will shut on the 21st of Feb.
(Copy pasted from discord)



Details you need to know





To gain access to add an admin edit your name through the RDZ-Admins include and use /gainaccess then you can do /makeadmin (It's like an rcon thing depending on your name)



You should also edit the server ip and forum through the RDZ-Inners file to the random messages being sent You also need to edit your discord channel ids from the 0000's through the RDZ-Init and Main files You also should edit the Andy[RDZ] name inside the /gainaccess command in the RDZ-Admins file



There a few unfinished things, this wasn't really a big thing it was just me and close friends and memories, drifting in samp isn't that big, the GPS, drug dealer and dialogs are unfinished until this point I don't know if i'll update this again.



RDZ ref



The references to RDZ are too much for me to remove but i did replace things wtih 'Server' Kindly don't use the server name and re-host it claiming it to be us or me.



You can contribute by doing a PR or editing it privately to your own will but anything refering as credits to me or anyone is not to be removed.





More





I'm not much of a scripter anymore my portal on how to do anything was sa-mp so this is how i got to know everything This is my first SQL script and my second modular-way script so don't expect it to be top notch but it was decent enough for me.



Running





You will find dependencies in the release section, you will also find a zip of the server you can use to run on your windows attached in the releases as well. This was ran and built using sampctl, you can take all the legacy and dependencies and drop them in an includes folder if you're using pawno or whatever.





Christmas-mod and 0.3.7DL





You will find in the Main file two definitions if you run 0.3.7DL then comment out the enable R2 version (It will automatically include a few files like the maps and stuff for VC and LC and a few skin add-ons that i had) And the christmas part will give you a few commands and it will cover the whole map in snow alongside falling snow.



Separated folders







I understand that the constant part alongside my anti-cheat should've been dependencies as well but i was trying to do a few changes on my own when i faced issues thats why i just dropped them all in a folder where i thought they'd be constant as in me rarely editing them, but yeah. easier for you, easier for me.



Features





To the part where i should state what this had but I can't be bothered, it's just a drift server, a drift counter, a few drift battle events, stats save along with levels and a few events like the team deathmatch and the monster knock-out, a job like the cops one where u can chase wanted people and put them in jail, it's got my anti cheat on it and you will find shops all over the map if you use the database i provided as i created a little SQL script that enables you to create shops you'll find the command inside its just /createshop and you choose it then it'll be there for good (Saved inside the database). There's also a house system which is /createhouse [name] where it will create a house and allow players to do /home or whatever to teleport to it, all of this is done in-game.

I will upload the database with shops all over the map later, it has mapicons, npcs you can interact with (dialogs were never finished but you can finish them) and the interiors ofc.

You will find a lot of showcases to my server on this youtube channel if you want: https://www.youtube.com/channel/UCoaXM9N...UJw/videos



EDIT: The shops will be in a .csv file you can import as a table using the SQLiteDatabaseBrowser software (Attached file on repository)

TOTAL: 144 shops


Brick Texture Studio Guide
Posted by: Uproar - 2020-02-15, 01:12 PM - Forum: Tutorials - Replies (1)

Texture Studio - A Basic Guide



A?texture studio guide with basic commands and tips.



Installation

Click?here?to see all versions of Texture Studio. I recommend 1.9c but it's upto you. Then click on the?Source Code (.zip). Once downloaded, unzip it to a folder you want, I use Documents. Then download the?Windows Server. The provided link is for 0.3.7 R2. If you wish to get the 0.3.DL R1 server, click?here.

Make a new folder in your documents with any name, and unzip the server.zip download to there. Open the folder, copy the samp-server.exe and paste it in your texture studio folder.

Done.



Launching Texture Studio

To launch texture studio, you need a working SAMP version which matches your server.zip download.

Go to Texture Studio folder, double click and open the samp-server.exe. It is the backbone of your texture studio server! Do not close it while mapping. Now open your SAMP client, and click 'Add Server'. Enter the IP as?localhost?and if this doesn't work, delete and add a server with IP?127.0.0.1. This should work. It should show up like?this. Connect to the server.

And you should be in-game now with Texture Studio loaded!



Creating a Map

To create a new map, once you go in-game, type?/newmap. Enter the shortest name that comes into your mind. For example, I'd name?San Andreas State Police HeadQuarter Map?as?sasphq. As simple as that.?



Placing, Selecting and Editing Objects

To create a new object, use?/cobject. Either fetch object IDs from?here?or you can do it the other way where you don't need to use /cobject.?

In this method, use?/osearch. Don't enter the full name of the object you're searching. Like for 'pipe', use 'pip' instead for more results, some objects are named weirdly. Now a list of search results should pop up on the left side. Click on each of them to see a preview and click?Create?when you find the appropriate object!.



For selecting, use?/sel?followed by the Index. Then use?/editobject?to edit it. To clone/duplicate the object, press?Left ALT?when the /editobject GUI is open. For proper rotations and movement, use?/rx, /ry, /rz?and?/ox, /oy, /oz?respectively followed by rotation/movement value.?

For example, I want to rotate a wall by 90 degrees. I'll use /sel to select it then I'll use?/rz 90.?Here?is a small demonstration of me using it.



Tiling

Tiling is an important part. Select an object with /sel and then type?/sindex. There will be several numbers shown. Each number indicates one tile. An object can have innumerable number of tiles. 1, 2, 3, etc.. You need to focus on the one you're using. /mtcolor and /mtset depends on this.

To reset the tile labels, use?/rindex

Each object has unique tiling. Now while I was making a floor with the man_parquet texture (3840), tiling held a lot of importance.

Look at the images below. Different objects, same texture. Notice the difference??

[Image: ce1Tfvpl.png]





You're right, different tiling! Look at their tiling:-



[Image: bQF0rYFl.png]





Groups

To add objects to a group, use?/gadd?followed by the object Index. To edit the group, use?/editgroup. Again, you can always use the rotation and movement commands which are?/grx, /gry, /grz?and?/gox, /goy, /goz?respectively. Refer to the above paragraph for more information.



Use?/grem?to remove a particular object from the group or use?/gclear?to clear the whole group selection. If you wish to delete all the objects in the group, use?/gdelete?and use?/gclone?to clone all the objects in the group.



Use?/gmtset?to set a texture for all of the objects in the group and use?/gmtcolor?to set the color.



I'll tell how /gmtcolor and /mtcolor works, in the next section.



Below is a demonstration of a few of them.

[Image: xkZvmK4.gifl]





Texturing

Use?/mtextures?to open the texture pallete. Scroll through the pallet using?Y and H. Use?Numpad 4 and Numpad 6?to change texture pages. Use?Left ALT?to apply a texture. Did a mistake? Use?/mtset 0 0. 0 is the default texture for any object, every object has its own unique one.?

Use?/tsearch?to search for a texture and click on the one you want. You'll see the texture index on the bottom right of your screen. Use?/mtset 0 [Texture ID]?where the 0 is the tile ID and Texture ID is the Index.



/mtcolor?and?/gmtcolor?use the same format.

/mtcolor 0 0xFFFF0000 is what I used in the demonstration above.

Here, I divided it for you.

[Image: hurLtxwl.png]





Site used to fetch color hexcodes:?http://www.colorpicker.com/



Lighting and Shadows

The default GTA lighting and textures are horrible sometimes. Either too dark or too bright. There's a way to fix it.

I've just explained /mtcolor above. Understand it then read further in this section.



Okay so now that you know what /mtcolor exactly does, you can use it to fix the lighting.?

Type?/mtcolor 0 0xFFFFFFFF. It'll set a uniform shadow/highlight value to all indexes/tiles of the object.



Text

Use?/sel?to select an object and then use?/text?to edit text.

Firstly, set?Font Bold to "On"?because thin fonts look bad.

Then set alignment to?Center

Then set?Font Size to 512x128 or 512x256 or 512x512. Just keep in mind that these numbers (like 512, 128, etc.) indicate the number of pixels. So, more the number of pixels, clearer is your text.

I'd suggest?Ariel or Calibri Font for a modern themed text. Go for?Engravers if it's an old-styled map.

Then?Click on Edit Font. A box will pop up.

Enter your text in the format shown below.

In the end, set?Font to "On'.

[Image: tACVjHz.pngl]





For using text, I'd suggest using the?plane?objects. They don't have collision and are good for using text. I also use the?Rockstar Mat?object sometimes.?



Handling Default GTA Objects

The default GTA mapping may seem weird sometimes or maybe you want to remove some default objects to make a map there. Or do you want to change the texture and placement of the default objects?

Use?/gtaobjects?to have texture studio show you all GTA objects. Then you'll see the index in the first line.

To remove the object, type?/remobject.

To either bring it back or to simply swap a non removed GTA object into a texture studio object, type?/swapbuilding.

Keep in mind, if you remove a default object then swap it to a texture studio object and then if you delete your object, you can only bring it back via?/undo



Exporting

To export your map as a filterscript, use?/exportallmap. Put draw distance more than 500.0, always. It'll be saved in Texture Studio Folder > scriptfiles > ExportMaps.

To import it as filterscript, first open the .pwn export in pawno and press F5 to compile. Then put .amx file in your filterscripts folder.

To export your map as simple .txt file, use?/exportmap. Again, draw distance 500.0 or above.

Select the type of code you want, CreateObject or CreateDynamicObject then click Export. It'll be saved as a .txt file in Texture Studio Folder > scriptfiles > ExportMaps.



Texture Studio Common Bug Fixes


  • Some commands not working-?Quit SAMP, close and re-open samp-server.exe

  • The Co-Ordinates are messed up-?Sometimes rotating along one axis rotates it along another, the object is bugged. Delete the object, restart SAMP and samp-server.exe

  • No commands work-?Your Texture Studio download must be incomplete. Delete all of the files and re-install it once again.




[Image: YoAM8rR.png]



I hope you liked the guide.

Ask in a reply below?if you have any questions.


  Detailed Mapping Guide/Tips
Posted by: Uproar - 2020-02-15, 12:59 PM - Forum: Tutorials - Replies (3)

Hello everyone, this guide was posted back in April 2018 on the SAMP forum- but since I can't acces it from where I live, I'll be reposting it here.
Many of you want to start mapping, but lack either the motivation or the ideas. Here in this thread, I'm going to list some tips, some commonly known bugs, useful objects and such.

Quote:You need to have a criticism sense, I know your map is like your baby and you think its all beautiful and stuff, but its not. You need to get over this mentality and judge your map objectively.
This thread mainly is about roleplay maps but some tips can come in handy with all types of maps


Map Editor Choice

This is completely your own choice.
  • If you're going for mapping without textures and just with normal objects, without text and stuff, use Map Editor. This is not an in-game editor, but a seperate program.
  • If you're going for an in-game map editor with textures, text and actor anim support, go for Fusez's Map Editor. This has an in-built smoothcam too, so you can record videos for your showcase pretty easily. It has a lot more, so you can click on the thread and check it out yourself.
  • Then comes my personal favorite program, Texture Studio.?It is by far the easiest program with a lot of features. You may think it is complicated but it is not.
  • In the end, the Ultimate Creator. This one deserves more peers but I didn't work with it, so don't know how is it. As far as I know, this editor mainly works with keyboard shortcuts and such, check the thread for more information.


Object Choice and Placement

Coming to the objects, you need to have a really good imagination and creativity. In Texture Studio, you can still edit textures and make them look almost completely different! But in map editors without texture support, this can be a nightmare. You can also edit textures in the code with SetObjectMaterial but it isn't easy, neither do I know more about scripting.

For object and texture IDs, use this website.
I'll list below how to use that website.
  • Object selection- Use objects that suit your theme. If you're making a old styled map like for a county server, use wooden textures, mostly. DO NOT use any modern objects in such a map. Vintage objects work the best with such a map. Just imagine yourself being in the 1950s, how would it feel? What would your environment consist of? There, that's how you decide your objects. In a modern themed map, use any object you want but don't use objects with too plain textures. If you still plan to make them look better and realistic, retexture them to a proper texture combination without making it look cartoonish. Collision holds a major role here too. If you need players to NOT pass through a particular object, use an object with collision. If you're really scrict about how players collide with an object and if the object doesn't have a proper collision like this, simply use the chip objects (The stack of coins in gambling).
[Image: pDu2aQQl.png]
  • Object Placement- Placing objects is a major part of the map. If you're using Map Editor, it's comparatively difficult to align some objects properly (They either float in the air or are badly aligned along). In texture studio, use the /editobject GUI to place them properly. Now you might need an object which isn't there in GTA SA? Use your creativity. Make a new object with small existing objects. For example, a computer monitor. There isn't a modern one available. So use the LCDTV1 object and for the stand, either use the Lava Lamp and retexture it and place it behind the LCD TV so that it looks like a screen or use 2 Switch objects (Retexture them according to your needs). Then place one horizontal and another one at 45 degrees so that it holds the LCD TV like this.


If you're placing two object side by side or very near to make one big object, make sure they don't overlap along and become glitchy like below. To avoid it, simply move the second object back by 0.001 along the forward/backward axis (/ox 0.001 or /oy 0.001 in Texture Studio), so it doesn't really look like it's behind but avoids the glitch.
[Image: ead1n4C.gifl]

Flashhie Wrote:If you place small detailed objects, never place them at a 90 degree angle. Because in real life nobody places the stuff on table perfectly, even if they want it to.

And that's right! Have a look at this:-
[Image: HU22sfE.png?1]
[Image: c4bV3nW.png?1]



Textures

Textures are a very important part of your map. Good textures can make it look so realistic, believe me. I always placed objects and only used the concrete texture (Index 3 in texture studio) but later I realised how good does proper texturing result in. Again, if you're making a old styled map, use old textures. Mostly wood.

Useful Wooden Textures - 223, 229, 230, 288, 301, 1054, 3840.

For a modern-themed map, NEVER use plain textures like 8691 to 8705. Use textures that look realistic, you won't want your map to look like a minecraft map, do you? Ever seen plastic walls of a building? No. Use concrete textures. If you still like plain textures, use texture ID 3 and edit the color with /mtcolor. Do not use plain textures. They may look decent with your ENB Shaders but not everyone has ENB, so don't use plain textures at all!
Now you can always use /mtcolor to set the color in texture studio. More details about this in the Texture Studio section below.
If you wish to find texture of a default GTA object, go here, search for your object and once you get it click on the "Details" button, then click here and you'll get a list of the textures on it. Go to texture studio and use /tsearch [Your texture name] (Remove the square brackets).


It's really easy. Use the search bar or the categories below to search for an object. Then if you see your object on the screen, click on it, then click on details. To get the textures of that object, click on the .txd file on the right side of your screen. Then go in game and use /tsearch [Texture Name] to search for it. Below is a demonstration. (Sorry for the bad quality, it's because I made it into .gif instead of a YouTube video which will be annoying to open)
[Image: RXbp7Hv.gifl]


Below, I'll show you how to get the position(s) of a certain object. For example the pershing square object. Search for it, scroll down and click on "Fullscreen / Position Export" then you'll see the co-ordinates on the right side of your screen. Here is a demonstration of the same:-
[Image: k84M1Cb.gif]


Searching an Object by position
Click on the small location blip icon in the search bar. The San Andreas Map will pop up, click on the location you wish to see the objects near to, and it'll show all of them.
[Image: kAR9xzRl.png]


Useful Textures
Concrete textures- 3, 139, 8438, 8535.
Wood textures- 223, 229, 230, 288, 301, 1054, 3840.
Glass and window textures- 1123, 3565.



[Image: YoAM8rR.png]

I hope you like it.
Questions and suggestions are welcome.
For more help, ask below in a reply.


  Deleted
Posted by: NexoR - 2020-02-13, 10:10 AM - Forum: Pawn Scripting - No Replies

Fix...


  Idlewood Monica Park [3DL 3DSMAX]
Posted by: Gtamodel - 2020-02-09, 12:42 AM - Forum: Videos and Screenshots - Replies (1)

Idlewood Monica Park

.Credits: Kaptanderya, Rockstar

[Image: 12.png]

[Image: unknown.png]

[Image: unknown.png]

[Image: unknown.png]

[Image: unknown.png]

[Image: unknown.png]


  Police Station Exterior - Interior [3DL 3DSMAX]
Posted by: Gtamodel - 2020-02-09, 12:29 AM - Forum: Maps - Replies (2)

San Andreas State Police?






.Credits: Kaptanderya, Rockstar, Gtamodel?

program 3DSmax, 8?dff - 1 txd = 2MB

[Image: sa-mp-090.png]

[Image: sa-mp-105.png]

[Image: sa-mp-089.png]

[Image: sa-mp-092.png]

[Image: sa-mp-107.png]

[Image: sa-mp-094.png]

[Image: sa-mp-097.png]

[Image: sa-mp-099.png]

[Image: sa-mp-101.png]

[Image: sa-mp-098.png]


  tricks with savanna from my friend
Posted by: kocis - 2020-02-06, 04:22 PM - Forum: Videos and Screenshots - No Replies

[Video: https://www.youtube.com/watch?v=HFKHwu73fOE]


  GeoLite
Posted by: George - 2020-02-05, 11:26 AM - Forum: Libraries - Replies (5)

GeoLite (SQLite)



It is based on the free product GeoLite2 by MaxMind.



I was updating the country database every month for MySQL and decided to update the GeoIp databases by Whitetiger's include as many people requested. It turned out I was unable to, the way the databases were structured. I converted my version to SQLite and started comparing the two includes with geolite.inc being victorious. But this was to be expected with not only the good database structure and the use of indexes but also the appropriate queries to avoid range scans. Even though latest database provide more data than last year, it did not affect the performance in any way.



The past days, I managed to import Autonomous System (AS) and City databases with the original databases having big flows.


  • Certain organizations in Autonomous System list did have many unique identifiers (ASN - Autonomous System Number) registered to IANA. All duplicates were removed and kept only their initial ASN.

  • Certain ip ranges in City database:
    • did not provide a city name. Country name was used in replacement.

    • did not provide a city name, nor a country name. Continent name was used in replacement.



The above issue arose another problem related to time zones.
  • Antarctica, Asia and Europe have time zone set as :00

  • Cities with country name as replacement have central standard time set mostly, with few exceptions. Some examples are:
    • United States is set to have UTC -05:00 (Washington, DC) whereas Central Standard Time is in Chicago (-06:00)

    • Russia is set to Moscow Standard Time (:00)



I initially posted these changes and improvements in Whitetiger's thread but due to their absence, I decided to create a new thread. I was also unaware if Whitetiger would accept the changes, nor how the updates would be done.



Installation



Repository: https://github.com/George480/geolite

Releases: https://github.com/George480/geolite/releases

Include: https://raw.githubusercontent.com/George...eolite.inc



Save as geolite.inc into pawno\include folder. Include in your code and begin using the library:



Code:
#include <geolite>



Place the database you want to use into scriptfiles folder.



Functions

IP-Based Functions:
  • GetIpAutonomousSystem(const geolite_ip[], geolite_dest[], geolite_len = sizeof (geolite_dest))
    • Stores the Autonomous System organization (ISP is an Autonomous System) according to given IP, passed by reference.

    • Returns 1 on success (database file exists in scriptfiles folder) or 0 on failure.


  • GetIpCountry(const geolite_ip[], geolite_dest[], geolite_len = sizeof (geolite_dest))
    • Stores the Country name according to given IP, passed by reference.

    • Returns 1 on success (database file exists in scriptfiles folder) or 0 on failure.


  • GetIpCity(const geolite_ip[], geolite_dest[], geolite_len = sizeof (geolite_dest))
    • Stores the City name according to given IP, passed by reference.

    • Returns 1 on success (database file exists in scriptfiles folder) or 0 on failure.


  • GetIpUTC(const geolite_ip[], geolite_dest[], geolite_len = sizeof (geolite_dest))
    • Stores the UTC offset according to given IP, passed by reference.

    • Returns 1 on success (database file exists in scriptfiles folder) or 0 on failure.


  • IsIpProxy(const geolite_ip[])
    • Requires country database.

    • Returns 1 if the given ip is public proxy otherwise 0. It will also return 0 if database file does not exist in scriptfiles folder.


Player-Based Functions:
  • GetPlayerAutonomousSystem(playerid, geolite_dest[], geolite_len = sizeof (geolite_dest))
    • Stores the Autonomous System organization (ISP is an Autonomous System) according to given player's IP, passed by reference.

    • Returns 1 on success (database file exists in scriptfiles folder and player is connected) or 0 on failure.


  • GetPlayerCountry(playerid, geolite_dest[], geolite_len = sizeof (geolite_dest))
    • Stores the Country name according to given player's IP, passed by reference.

    • Returns 1 on success (database file exists in scriptfiles folder and player is connected) or 0 on failure.


  • GetPlayerCity(playerid, geolite_dest[], geolite_len = sizeof (geolite_dest))
    • Stores the City name according to given player's IP, passed by reference.

    • Returns 1 on success (database file exists in scriptfiles folder and player is connected) or 0 on failure.


  • GetPlayerUTC(playerid, geolite_dest[], geolite_len = sizeof (geolite_dest))
    • Stores the UTC offset according to given player's IP, passed by reference.

    • Returns 1 on success (database file exists in scriptfiles folder and player is connected) or 0 on failure.


  • IsPlayerUsingProxy(playerid)
    • Requires country database.

    • Returns 1 if the ip of the given player is public proxy otherwise 0. It will also return 0 if database file does not exist in scriptfiles folder.



Usage

Code:
#include <a_samp>

#include <sscanf2>

#include <geolite>



main() {}



public OnPlayerConnect(playerid)

{

? ? new player_name[MAX_PLAYER_NAME], player_country[MAX_COUNTRY_LENGTH], connection_text[80];

? ??

? ? GetPlayerName(playerid, player_name, MAX_PLAYER_NAME);

? ? GetPlayerCountry(playerid, player_country, MAX_COUNTRY_LENGTH);



? ? format(connection_text, sizeof (connection_text), "%s joined from %s", player_name, player_country);

? ? SendClientMessageToAll(0xFFFF00FF, connection_text);

? ? return 1;

}



Extra Notes

127.0.0.1 is given as "Unknown" as it is a private IP.



Country, City and ASN databases will be updated every first Wednesday of every month.



It opens the databases on startup according to which database exists in scriptfiles folder, therefore if you prefer to use the Country database only, place maxmind_country.db into scriptfiles folder and not the other two databases.



It only detects public proxies and not VPNs.



A MySQL version would require non-threaded queries to keep the same usage of functions. If you have any suggestion, please inform me.



Constants:

Code:
#define MAX_AUTONOMOUS_SYSTEM_LENGTH? ? 95

#define MAX_COUNTRY_LENGTH? ? ? ? ? ? ? 45

#define MAX_CITY_LENGTH? ? ? ? ? ? ? ? ?64

#define MAX_UTC_LENGTH? ? ? ? ? ? ? ? ? 7



Requirements

sscanf: https://github.com/maddinat0r/sscanf/releases



Credits


  • MaxMind - GeoLite2

  • Alex "Y_Less" Cole - sscanf

  • Andy Skelton - ordering by `ip_to` (avoidance of range scan)

  • Nikolay Bachiyski - ordering by `ip_to` (avoidance of range scan)

  • Mark Robson - highest `ip_from` which is less than or equal to the given IP (avoidance of next country returned due to gaps)


  Indirection_OnGameModeInit
Posted by: offr0ad - 2020-02-04, 11:50 AM - Forum: Programming - Replies (1)

After long time I started working with my gamemode and tried to compile my gamemode "sampctl package build".
After that it updated dependencies and indirection.inc was added, but it gives ...dependencies\indirection\indirection.inc:940 (error) undefined symbol "Indirection_OnGameModeInit".
What may cause the problem and how should it be fixed?