Giter Site home page Giter Site logo

ramon-sd / marker-plus Goto Github PK

View Code? Open in Web Editor NEW
15.0 1.0 3.0 763 KB

Enables the creation of custom markers for SA-MP.

License: MIT License

Pawn 100.00%
include pawn samp sampctl gta mod library samp-package samp-server san-andreas san-andreas-multiplayer

marker-plus's Introduction

samp-include

exemplo imagem

Enables the creation of custom markers for SA-MP.


  1. Installation

  2. Documentation


๐Ÿš€ Installation

You can install the "Marker Plus" library in two ways:

  • Using sampctl: You can install the library using the sampctl package manager. Simply run the following command in the terminal:
sampctl package install Ramon-Sd/marker-plus
  • Using Git: You can clone the library's Git repository and manually add it to your project. Run the following command in the terminal:
git clone https://github.com/Ramon-Sd/marker-plus.git

Then, include the "markerplus.inc" include file in your code:

#include "markerplus.inc"

โ˜• Documentation

Functions

  • CreateMarker: Creates a custom marker. This function returns a unique marker ID.

  • Parameters:

    • icon (icon): The marker icon. It can be one of the icons defined in the enum.
    • calledActive (active): Indicates whether the marker is active or not.
    • x, y, z (coordinates): The coordinates of the marker in the SA-MP world.
    • worldID (optional): The ID of the world where the marker is located. The default is -1 (main world).
    • interiorID (optional): The ID of the interior where the marker is located. The default is -1 (no interior).
    • drawDistance (optional): The marker's draw distance. The default is 0.0 (always draw).
  • Return:

    • Returns the ID of the created marker, or a warning message if the marker limit is reached.
  • DestroyMarker: Destroys an existing marker in SA-MP.

  • Parameters:

    • markerid (marker ID): The ID of the marker to be destroyed.

Callbacks

  • OnPlayerEnterMarker: Called when a player enters the area of a marker.

  • Parameters:

    • playerid (player ID): The ID of the player who entered the marker area.
    • markerid (marker ID): The ID of the marker whose area was accessed.
  • OnPlayerLeaveMarker: Called when a player leaves the area of a marker.

  • Parameters:

    • playerid (player ID): The ID of the player who left the marker area.
    • markerid (marker ID): The ID of the marker whose area was left.

Example

#include "markerplus.inc"

main()
{
	return 0;
}

static myMarker;

public OnGameModeInit() {

	myMarker = CreateMarker(ICON_FACTORY, true, 0.0, 0.0, 0.0);
	return 1;
}

public OnGameModeExit() {

	DestroyMarker(myMarker);
	return 1;
}

public OnPlayerEnterMarker(playerid, markerid) {

	return 1;
}

public OnPlayerLeaveMarker(playerid, markerid) {

	return 1;
}



This project is licensed. See the LICENSE file for more details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.