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

Username
  

Password
  





Search Forums



(Advanced Search)

Forum Statistics
» Members: 8,092
» Latest member: Kaja932
» Forum threads: 2,437
» Forum posts: 12,456

Full Statistics

Online Users
There are currently 294 online users.
» 0 Member(s) | 290 Guest(s)
Bing, Google, Facebook, Applebot

Latest Threads
PawnPro 3.0 — Extensão VS...
Forum: Portuguese/Português
Last Post: NullSablex
Yesterday, 10:58 AM
» Replies: 0
» Views: 35
Harmony Maps
Forum: Maps
Last Post: Harmony
Yesterday, 09:36 AM
» Replies: 0
» Views: 36
SOLS Roleplay (2026)
Forum: Advertisements
Last Post: TyDolla
2026-04-18, 04:47 PM
» Replies: 0
» Views: 47
SOLS Roleplay (Official T...
Forum: Videos and Screenshots
Last Post: TyDolla
2026-04-18, 04:45 PM
» Replies: 0
» Views: 43
SAMPHUB.
Forum: Spanish/Español
Last Post: picxii
2026-04-16, 02:14 PM
» Replies: 19
» Views: 41,372
Project: LAS VENTURAS ROL...
Forum: Advertisements
Last Post: Kremzy
2026-04-15, 12:49 AM
» Replies: 0
» Views: 73
🎮 Free SA-MP Server Hosti...
Forum: Chat
Last Post: Centnodes
2026-04-12, 11:29 PM
» Replies: 15
» Views: 3,733
Classic Party Server [ENG...
Forum: Advertisements
Last Post: GPCServ
2026-04-11, 10:12 PM
» Replies: 0
» Views: 163
Valrise RPG (PC/Android)
Forum: Advertisements
Last Post: Habshi
2026-04-08, 10:46 AM
» Replies: 0
» Views: 124
UZS Zombie Survival
Forum: Advertisements
Last Post: phnx
2026-04-04, 05:32 PM
» Replies: 0
» Views: 101

 
  vModData - Component helpers
Posted by: Markski - 2020-12-19, 02:41 AM - Forum: Libraries - No Replies

vModData is a simple include which provides helpers for components.

Helpers include getters for component names, slots and categories, as well as functions that return wether a vehicle is compatible with a given component id or slot type, amidst others.

Detailed function list and download available on GitHub


  [INCLUDE] vModData
Posted by: Markski - 2020-12-19, 02:37 AM - Forum: Spanish/Español - Replies (3)

Nada, un simple include con helpers para componentes/tunning en SA-MP.



Sirve para obtener nombre, precios, categorias de componentes, entre otras cosas.



https://github.com/markski1/mrks_vModData


Rainbow Best way to load data from database (MySQL r41)
Posted by: shane adevaratu - 2020-12-18, 10:58 AM - Forum: Pawn Scripting - Replies (6)

What is the most efficient way to load data from the database.
For example, how could I make the function below more efficient.

Code:
function loadDealerShip( ) {
    new DS_Models = cache_num_rows( ), x, result;
    if( DS_Models == 0 ) return print( "Loaded models: no rows detected" );
    for( new i, j = DS_Models; i != j;  ) {
        cache_get_value_name_int( i, "ID", result ), x = result, dsVariable[ x ][ dsID ] = x;
        cache_get_value_name_int( i, "Model", dsVariable[ x ][ dsModel ] );
        cache_get_value_name_int( i, "Stock", dsVariable[ x ][ dsStock ] );
        cache_get_value_name_int( i, "Speed", dsVariable[ x ][ dsSpeed ] );
        cache_get_value_name_int( i, "Price", dsVariable[ x ][ dsPrice ] );
        cache_get_value_name_int( i, "Type", dsVariable[ x ][ dsType ] );
        cache_get_value_name( i, "Car", dsVariable[ x ][ dsName ] );
    } printf( "Loaded models: %d", DS_Models );
return true; }


The 'ID'?starts at 1 and reaches over 100.


  [AJUDA]Travar o comando para destruir o veiculo
Posted by: willian franco - 2020-12-16, 10:36 PM - Forum: Portuguese/Português - Replies (1)

Boa noite!! criei um comando para criar o veiculo e outro para destrui-lo porem gostaria de travar para destrui-lo quando o player estiver no veiculo, o comando consegue destruir mesmo n?o estado no veiculo.??



Code:
? ? CMD:dcivil(playerid, x_nr[])

{

if(!strlen(x_nr))

{

? ? SendClientMessage(playerid, COLOR_GRAD1, "USE: /dcivil [numero do veiculo]");

}

? ? ? return 1;

}

else if(strcmp(x_nr,"1",true)==0)

{

? ? ? ?? ? ? ? ? ? ?DestroyVehicle(Civilcarro[0]);

? ? ? ? ? ? ? ? ? ? carrocivil[0] = 0;

? ? ? ? ? ? ? ? ? ? SendClientMessage(playerid, COR_AMARELO, "Veiculo Civil Destruido..");

? ? ? ? ? }

? ? ? ? ? }

? ? return 1;

? ? }

else if(strcmp(x_nr,"2",true)==0)

? ? ? ? ? ? {

? ? if(carrocivil[1] == 1)

? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? DestroyVehicle(Civilcarro[1]);

? ? ? ? ? ? ? ? ? ? carrocivil[1] = 0;

? ? ? ? ? ? ? ? ? ? SendClientMessage(playerid, COR_AMARELO, "Veiculo Civil Destruido..");

? ? ? ? ? }

? ? ? ? ? }

? ? ? ? return 1;

? ? }

? ? else if(strcmp(x_nr,"3",true)==0)

? ? ? ? ? ? {

? ? ? if(carrocivil[2] == 1)

? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? DestroyVehicle(Civilcarro[2]);

? ? ? ? ? ? ? ? ? ? carrocivil[2] = 0;

? ? ? ? ? ? ? ? ? ? SendClientMessage(playerid, COR_AMARELO, "Veiculo Civil Destruido..");

? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? return 1;

? ? ? ? }

? ? else if(strcmp(x_nr,"4",true)==0)

? ? ? ? ? ? {

? ? ? ? ? ? ? if(carrocivil[3] == 1)

? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? DestroyVehicle(Civilcarro[3]);

? ? ? ? ? ? ? ? ? ? carrocivil[3] = 0;

? ? ? ? ? ? ? ? ? ? SendClientMessage(playerid, COR_AMARELO, "Veiculo Civil Destruido..");

? ? ? ? ? ? ? ? }

? ? ? ? return 1;

? ? ? ? }



os comando em diante s?o todos iguais por isso n?o coloquei ele completo.



objetivo -? estou testando esse sistema para tentar diminuir a quantidade de ve?culos no servidor que esta est?o sendo usado.



Quero apenas pode usar o comando no veiculo desejado estando no motorista.

voltei a pouco tempo a editar servidor?

obrigadooo a comunidade!!!?


Star [MAP] Medical Department/Hospital - Exterior
Posted by: RisQ Development - 2020-12-16, 07:56 AM - Forum: Videos and Screenshots - Replies (1)

Good Morning,



i want?to show you a new Map , the Medical Department.



Objekts: 640 Objects

Mappingtime: 4 Days

YouTube URL:?https://youtu.be/pLBL1SUce5k



Thank you.


  CODE: A Hands-on Approach
Posted by: phlair - 2020-12-16, 02:01 AM - Forum: Tutorials - Replies (3)

Information



CODE: A Hands-on Approach (cahoa) is a project that aims to serve as a hands-on tutorial for teaching programming (via PAWN, and currently SA-MP). People of different skill levels/experience will benefit from this, but it is mainly targeted at beginners.



Details



You'll find the most up to date draft as a GitHub Gist here



I look forward to your responses and feedback!



Update



The Git Repository is live, and can be found?on GitHub



I'll update it over time, and give some progress updates here and on Discord.


  Disappearance of dynamic objects
Posted by: Radical - 2020-12-15, 11:07 PM - Forum: Pawn Scripting - Replies (4)

I have 10,300 dynamic objects, some of which disappear after 24 hours.

Game mode runs on a vps with 1 GB of RAM.

The problem is the lack of RAM or what?


Wink Saving variables into multiple tables
Posted by: Epureanu - 2020-12-15, 01:13 PM - Forum: Pawn Scripting - Replies (8)

Hi, I am using a mysql saving system, that basically creates a enumerator with variables, but natively they are all saved into one table. I tried to just put a ", 2ndtablename" into the saving and loading query, but I had a feeling that it would save those variables both in the main table and the secondary. I need to save certain variables ONLY to second table. Is there any way on how to do this without running a new query for each table? Thanks!


  GetVehicleRotationQuat & GetVehicleZAngle
Posted by: Bakr - 2020-12-14, 07:54 PM - Forum: Questions and Suggestions - No Replies

Are there any plans?to fix these functions for unoccupied vehicles? Referencing the tip on the wiki

Quote:There is no 'set' variation of this function; you can not SET a vehicle's rotation (apart from the Z angle) This function may return incorrect values for unoccupied vehicles. The reason is that the third row of the vehicle's internal rotation matrix gets corrupted if it gets updated while unoccupied.


  samp-account
Posted by: Bakr - 2020-12-14, 07:49 PM - Forum: Libraries - Replies (5)

samp-account

samp-account was created to allow extensive user-account systems to be streamlined by not worrying about implementation details. This means we can have a fully working user account system, with data loaded from a database, and stored to a database, all with one function call.

samp-account uses the SA:MP native SQLite database system for storage, Slice?s pointers library for data binding, Y_Less? YSI hooks library for callback hooking, and Y_Less' Whirlpool plugin for encryption.

Installation

Simply install to your project:

Code:
sampctl package install bwhitmire55/samp-account

Include in your code and begin using the library:

Code:
#include <account>

Functions

Code:
/*
PARAMS:?
name - The name of the database column to store the data?
type - The psuedo-type of the data (TYPE_INT, TYPE_FLOAT, TYPE_STRING)?
{Float,_}:... - The variable to store the data?
?
RETURNS:?
1 on success, otherwise 0?
*/
stock AddAccountData(const name[ACCOUNT_MAX_COLUMN_NAME], Types: type, {Float,_}:...)

Code:
/*
PARAMS:  
playerid - The playerid to update the database for
{Float,_}:... - Which data to updat  
  
RETURNS:  
1 on success, otherwise 0  
*/
stock UpdateAccountData(playerid, {Float, _}:...);

Code:
/*
PARAMS:?
playerid - The playerid attempting to be registered?
password - The password of the player (in plain text)?
?
RETURNS:?
1 on success, otherwise 0?
*/
stock RegisterPlayer(playerid, const password[])

Code:
/*
PARAMS:?
playerid - The playerid attempting to be logged in?
password - The password of the player (in plain text)?
?
RETURNS:?
1 on success, otherwise 0
*/
stock LoginPlayer(playerid, const password[])

Code:
/*
PARAMS:?
playerid - The playerid to check?
?
RETURNS:?
1 (true) if logged-in, otherwise 0 (false)
*/
bool: IsPlayerLoggedIn(playerid)

Code:
/*
PARAMS:?
playerid - The playerid to check?
?
RETURNS:?
The unique-ID of the player in the database if exists, otherwise 0?
*/
stock GetPlayerUID(playerid)

Usage

Simply create variables in which to store your players? data

Code:
new
? ? gPlayerKills[MAX_PLAYERS],
? ? gPlayerHealth[MAX_PLAYERS],
? ? gPlayerNickname[MAX_PLAYERS][MAX_PLAYER_NAME];

Add that data to the system (and database) via AddAccountData

Code:
public OnGameModeInit() {
? ? AddAccountData("kills", TYPE_INT, gPlayerKills);
? ? AddAccountData("health", TYPE_FLOAT, gPlayerHealth);
? ? AddAccountData("nickname", TYPE_STRING, gPlayerNickname);

? ? return 1;
}

Anytime a user logs into their account, their information will be loaded from the database and into the corresponding variables. Likewise for disconnecting, their data will be updated inside the database.

NOTE: The variables do no reset themselves, so you should zero-out their values upon the player exiting the server.

You are free to use the variables as normal with no effect:

Code:
public OnPlayerDeath(playerid, killerid, reason) {
? ? gPlayerDeaths[playerid];
? ? return 1;
}

Now we just need to call RegisterPlayer or LoginPlayer. This will most likely be done via command/dialog

Code:
ZCMD:register(playerid, params[]) {
? ? if(IsPlayerLoggedIn(playerid)) {
? ? ? ? return SendClientMessage(playerid, 0xFF0000FF, "Already logged-in!");
? ? }

? ? if(isnull(params)) {
? ? ? ? return SendClientMessage(playerid, 0xFFFF00FF, "Usage: /register <password>");
? ? }

? ? if(RegisterPlayer(playerid, params)) {
? ? ? ? SendClientMessage(playerid, 0x00FF00FF, "You have successfully registered an account!");
? ? } else {
? ? ? ? // RegisterPlayer will return 0 if the account already exists, or there is an issue with the database.
? ? ? ? // For this example, we'll assume the former.
? ? ? ? SendClientMessage(playerid, 0xFF0000FF, "Error! This username is already registered.");
? ? }
? ? return 1;
}

And that?s it! You now have a fully working account system, which can store any data you like, without touching a database or file. Nice!

Callbacks

This library also includes two callbacks, OnPlayerRegister and OnPlayerLogin.

Code:
public OnPlayerRegister(playerid) {
? ? SendClientMessageToAll(0x00FF00FF, "A new member has registered!");
? ? return 1;
}

public OnPlayerLogin(playerid) {
? ? SendClientMessageToAll(0x00FF00FF, "An existing member has rejoined us!");
? ? return 1;
}

Macros

All macros are as followed:

Code:
// The database file
#define ACCOUNT_DATABASE? ? ? ? "mydatabase.db"

Code:
// The database table to store the account data
#define ACCOUNT_DATABASE_TABLE? "mydatabasetable"

Code:
// The amount of 'data' you wish to store
// i.e., how many times you will use AddAccountData
#define ACCOUNT_MAX_COLUMNS? ? (100)

Code:
// The maximum length of a column name in the database
#define ACCOUNT_MAX_COLUMN_NAME (24)

All of these can be redefined to suite your script

Code:
#define ACCOUNT_DATABASE? ? ? ? "COD-DB.db"
#define ACCOUNT_DATABASE_TABLE? "users"
#include <account>

Testing

To test, simply run the package:

Code:
sampctl package run