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

Username
  

Password
  





Search Forums



(Advanced Search)

Forum Statistics
» Members: 7,264
» Latest member: egirl
» Forum threads: 2,380
» Forum posts: 12,296

Full Statistics

Online Users
There are currently 293 online users.
» 0 Member(s) | 289 Guest(s)
Applebot, Bing, Yandex, Google

Latest Threads
AntyCheat System [SA-MP/O...
Forum: Filterscripts
Last Post: 2PAC_
Yesterday, 09:17 PM
» Replies: 7
» Views: 8,347
Iron Horizon Roleplay[v1....
Forum: Advertisements
Last Post: MikeNGRP
2025-07-11, 11:44 PM
» Replies: 0
» Views: 23
[MAP PACK] 5 NEW LS BUILD...
Forum: Videos and Screenshots
Last Post: Apollo4430
2025-07-11, 12:20 AM
» Replies: 1
» Views: 3,338
Open.mp / SAMP Query
Forum: Releases
Last Post: laex
2025-07-09, 04:07 AM
» Replies: 2
» Views: 127
some text appearing in my...
Forum: Support
Last Post: Sizy
2025-07-08, 07:33 AM
» Replies: 0
» Views: 37
Offensive-Core: TDM
Forum: Gamemodes
Last Post: NikitaFoxze
2025-07-08, 12:13 AM
» Replies: 3
» Views: 3,679
Second Generation Rolepla...
Forum: Advertisements
Last Post: JamesT
2025-07-06, 10:28 AM
» Replies: 0
» Views: 53
Servidor RPG profissões
Forum: Advertisements
Last Post: tcharlesmeurer
2025-07-05, 11:35 PM
» Replies: 0
» Views: 35
EVO Anti-Cheat
Forum: Libraries
Last Post: Eduardo_AC
2025-07-05, 11:05 PM
» Replies: 2
» Views: 115
Developer for Hire – Syst...
Forum: Pawn Scripting
Last Post: ejtamovic
2025-07-04, 08:35 AM
» Replies: 0
» Views: 79

 
  Team Selection (MySQL)
Posted by: homelessdrop - 2019-11-03, 02:08 PM - Forum: Pawn Scripting - Replies (2)

Hello dier forum member's.

I have a question about a team selection,?specifically in mysql login / register system.

I would like to make coops and robbers selection, after register give selection menu, where u know select of 3 type's, and spawn with it.?

Other about save/load that selected team i can make, just that "after spawn not".

Please, can u help me?

(script is maded by GTLS on samp-forum.?link)



PHP Code:
#include <a_samp>

#include <a_mysql> // Currently its R41-4.

#include <bcrypt> //Bcrypt is the best way of encrypting passwords.

#include <foreach> //foreach standalone version



//Defining MySQL stuff here



#define DB_HOST "localhost" //IP of your host. In case of using it on same pc, use localhost or 127.0.0.1

#define DB_NAME "login" //Name of Database you are gonna use.. I have used login, but change it according to your needs.

#define DB_USER "root" //User name of your MySQL client.

#define DB_PASS "" //Password of your MySQL client.



//Default Username is root and password is blank. You still gotta define them

//Make sure to install XAMPP server. Start Apache and MySQL service when you start the server. You can manage SQL databases from PHPMyAdmin which comes in built in XAMPP.



enum //Always use some kind of structure for Dialog IDs.

{

DIALOG_ASK,

DIALOG_REGISTER,

DIALOG_LOGIN

};



enum pinfo

{

MasterID,

Float:PX,

Float:PY,

Float:PZ,

Float:Rot,

Skin,

Level,



bool:LoggedIn

};

new 
pInfo[MAX_PLAYERS][pinfo];



new 
MySQL:handle//This connection handle of data type MySQL is required to carry out Mysql operations.



main()

{

printf("Login Script Loaded");

}



public 
OnGameModeInit()

{

handle mysql_connect(DB_HOSTDB_USERDB_PASSDB_NAME);



if(
mysql_errno(handle) == 0printf("[MYSQL] Connection successful"); //returns number of errors. 0 means no errors..

else

{

? ?new 
error[100];

? ?
mysql_error(errorsizeof(error), handle);

printf("[MySQL] Connection Failed : %s"error);

}



return 
1;

}



public 
OnGameModeExit()

{

foreach(new 
Player)

{

if(
pInfo[i][LoggedIn]) SavePlayerData(i);

}

mysql_close(handle);

return 
1;

}



public 
OnPlayerConnect(playerid)

{

new 
query[64];

new 
pname[MAX_PLAYER_NAME];

GetPlayerName(playeridpnamesizeof(pname));

mysql_format(handlequerysizeof(query), "SELECT COUNT(Name) from `users` where Name = '%s' "pname);

mysql_tquery(handlequery"OnPlayerJoin""d"playerid);

return 
1;

}



public 
OnPlayerDisconnect(playeridreason)

{

if(
pInfo[playerid][LoggedIn]) SavePlayerData(playerid);

pInfo[playerid][LoggedIn] = false;

return 
1;

}



public 
OnPlayerSpawn(playerid)

{

? ?
//Set your spawn info here...

return 1;

}



SavePlayerData(playerid)

{

new 
query[256], pname[MAX_PLAYER_NAME], Float:pxFloat:pyFloat:pzFloat:rot;

GetPlayerName(playeridpnamesizeof(pname));

GetPlayerPos(playeridpxpypz);

GetPlayerFacingAngle(playeridrot);

mysql_format(handlequerysizeof(query), "UPDATE `users` set PosX = %f, PosY = %f, PosZ = %f, Rot = %f, Skin = %d, Level = %d WHERE Master_ID = %d"pxpypzrotpInfo[playerid][Skin], pInfo[playerid][Level], pInfo[playerid][MasterID]);

mysql_query(handlequery);

printf("Saved %s's data"pname);

return 
1;

}





public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])

{

switch(
dialogid)

{

case 
DIALOG_REGISTER:

? ?{

if(
response)

{

? ?
bcrypt_hash(inputtext12"OnPassHash""d"playerid);

}

else 
Kick(playerid);

}



case 
DIALOG_LOGIN:

{

if(
response)

{

new 
query[128], pname[MAX_PLAYER_NAME];

GetPlayerName(playeridpnamesizeof(pname));

? ? 
SetPVarString(playerid"Unhashed_Pass",inputtext);

mysql_format(handlequerysizeof(query), "SELECT password, Master_ID from `users` WHERE Name = '%s'"pname);

mysql_tquery(handlequery"OnPlayerLogin""d"playerid);

}

else 
Kick(playerid);

}

}



return 
1;

}



forward OnPlayerJoin(playerid);

public 
OnPlayerJoin(playerid)

{

new 
rows;

cache_get_value_index_int(00rows);



if(
rowsShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_PASSWORD"Login""This account is found on your database. Please login""Login""Quit");





else 
ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_PASSWORD"Register""This account not is found on your database. Please register""Register""Quit");

return 
1;

}



forward OnPlayerRegister(playerid);

public 
OnPlayerRegister(playerid)

{

SendClientMessage(playerid0x0033FFFF /*Blue*/"Thank you for registering! You can now Login");

? ?
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_PASSWORD"Login""Thank you for registering! You can now Login with\npassword you just used to register.""Login""Quit");

return 
1;

}



forward OnPlayerLogin(playerid);

public 
OnPlayerLogin(playerid)

{

new 
pPass[255], unhashed_pass[128];

GetPVarString(playerid"Unhashed_Pass",unhashed_pass,sizeof(unhashed_pass));

if(
cache_num_rows())

{

cache_get_value_index(00pPass);

cache_get_value_index_int(01pInfo[playerid][MasterID]);

bcrypt_check(unhashed_passpPass"OnPassCheck""dd",playeridpInfo[playerid][MasterID]);

? }

? ?else 
printf("ERROR ");

return 
1;

}



forward OnPassHash(playerid);

public 
OnPassHash(playerid)

{

new 
pass[BCRYPT_HASH_LENGTH], query[128], pname[MAX_PLAYER_NAME];

? ?
GetPlayerName(playeridpnamesizeof(pname));

? ?
bcrypt_get_hash(pass);

? ?
mysql_format(handlequerysizeof(query), "INSERT INTO `users`(Name, Password) VALUES('%s', '%e')"pnamepass);

mysql_tquery(handlequery"OnPlayerRegister""d"playerid);

return 
1;

}



forward OnPassCheck(playeridDBID);

public 
OnPassCheck(playeridDBID)

{

? ?if(
bcrypt_is_equal())

{

SetPlayerInfo(playeridDBID);

}

else 
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_PASSWORD"Login""The password you just entered is wrong.\nPlease Try again!""Login""Quit");

return 
1;

}



SetPlayerInfo(playeriddbid)

{

new 
query[128];

mysql_format(handlequerysizeof(query), "SELECT ?PosX, PosY, PosZ, Rot, Skin, Level FROM `users` WHERE Master_ID = %d"dbid);

new 
Cache:result mysql_query(handlequery);



cache_get_value_index_float(00pInfo[playerid][PX]);

cache_get_value_index_float(01pInfo[playerid][PY]);

cache_get_value_index_float(02pInfo[playerid][PZ]);

cache_get_value_index_float(03pInfo[playerid][Rot]);

cache_get_value_index_int(04pInfo[playerid][Skin]);

cache_get_value_index_int(05pInfo[playerid][Level]);



pInfo[playerid][LoggedIn] = true;



cache_delete(result);



SetPlayerScore(playeridpInfo[playerid][Level]);

SetSpawnInfo(playerid0pInfo[playerid][Skin], pInfo[playerid][PX], pInfo[playerid][PY], pInfo[playerid][PZ],pInfo[playerid][Rot], 000000);



TogglePlayerSpectating(playeridfalse);

TogglePlayerControllable(playeridtrue);



new 
name[MAX_PLAYER_NAME], str[80];

GetPlayerName(playeridnamesizeof(name));

format(strsizeof(str), "{00FF22}Welcome to the server, {FFFFFF}%s"name);

SendClientMessage(playerid, -1str);

DeletePVar(playerid"Unhashed_Pass");



SpawnPlayer(playerid);

return 
1;



  Protection against map-stealing
Posted by: Mave - 2019-10-31, 04:43 PM - Forum: Questions and Suggestions - Replies (2)

Just hear me out.
Like many of you, I've been playing and creating stuff in SA-MP for over a decade. I've been creating maps since 2008 and still enjoy making these.
However ever since the release of "map stealers" putting out maps on public servers is pretty much pointless because someone can steal your map in no-time and put it in their own server.
A fix or protection for this in open.mp would be... amazing. It would aspire me and many others to start mapping again and not seeing your maps get stolen by others.

Disclaimer: I know many of you couldn't care less about maps (certainly since a lot of servers don't use objects that much), but please do consider my two cents.


  Kalcor removing many functions from SA:MP
Posted by: Y_Less - 2019-10-30, 04:53 PM - Forum: Pawn Scripting - Replies (6)

[Image: nDe1lF7.png]



https://forum.sa-mp.com/showpost.php?p=4...tcount=331



Quote:I'm removing CreateMenu and associated functions from 0.3.9 and future versions because it was added by Y Less and I'd like to eventually remove everything contributed by him.



I haven't come across a server in the last 10 years that uses GTA:SA menus.



Here is a list of things contributed by me. I hope your server doesn't rely on any of them:


  • Menus

  • Text Draws (except models)

  • Per-player objects (how every streamer works)

  • Virtual Worlds

  • Gang Zones (I think, not 100% on this)

  • SetTimerEx

  • CallLocalFunction (how many command processors works)

  • CallRemoteFunction

  • SendPlayerMessage

  • ForceClassSelection

  • Race checkpoints

  • Race checkpoints

  • GetPlayerWeaponData


  How do you make android app without Android Studio
Posted by: Tama - 2019-10-29, 11:54 AM - Forum: Programming - Replies (11)

I want to make something like?QuickEdit, but i'm confused where should i do for making an android app without android studio.
Yeah bcuz my?[Image: Potato.png] laptop can't handle it.


  Infamous internet speed / speedtest.net thread
Posted by: Jarnokai - 2019-10-29, 10:10 AM - Forum: Chat - Replies (36)

All of us have seen this before: Go to speedtest.net, do the test and embed your result for bragging rights.



To make this less spam and more conversational though, please tell us about your ISP and your experience with it, are you running mobile, DSL, cable, fiber? Also what speeds are you actually paying for? Previous ISPs, speeds, experiences?





Our apartment has fiber-to-cable, our subscription is 100/10 for 10?/month:

[Image: 3Pzojvg.png]



My mobile is a 4G LTE 100Mbps unlimited data plan for 18?/month:

[Image: Qjo8YRY.png]

This is the speed at my desk right now, obviously better/worse signal depending on where you are, better outside etc.



I always found it funny how my phone has 3x the upload speed of my computer. Would have extremely affordable 200, 400 and 1000 Mbps connections available as well but they would require taking a 2 year contract and I have not been willing to do that yet.



I still urge to get that gigabit internet for 40? a month :(


  O:MP Voice chat
Posted by: BitchLasagna - 2019-10-24, 12:35 PM - Forum: Questions and Suggestions - Replies (10)

It would be nice to do voice chat, for a certain radius, it would help a lot of RP servers, and it would also reduce the Community costs of using teamspeak, etc


  Some of my arts.
Posted by: BitchLasagna - 2019-10-24, 11:35 AM - Forum: Art - Replies (6)

This is some of my graphich designes, if you need design for your gaming community you can contact me.










[Image: iKUo9rj.jpg]



[Image: 8MusPPN.png]



[Image: 1qaAaXE.png]



[Image: wmmut2M.png]



[Image: nrRBJV2.jpg]





[Image: prpWTBN.png]



[Image: n5pJPG1.png]



[Image: q4Xm0vJ.gif]



[Image: D4S2vR0.gif]



[Image: z1nDwEM.gif]





I have a lot of works on my DeviantArt?so? if you like my art and you want some design for your game server, contact me.


  [MAP] My frist map.
Posted by: SQLT - 2019-10-23, 05:56 PM - Forum: Videos and Screenshots - No Replies

It looks like on lsrp because I got some ideas from there. And trying to add other OBJs. And I also managed a house in Crenshaw by replacing the new house.



[Image: g7E2dQ.png]

[Image: g7EPnV.png]

[Image: g7ECZS.png]

[Image: g7Ey9q.png]


  [FILM] Connect - Poziv doma
Posted by: MirsoN - 2019-10-23, 01:09 PM - Forum: Videos and Screenshots - No Replies


  [JOB] Taxi with actors
Posted by: MirsoN - 2019-10-23, 12:38 PM - Forum: Videos and Screenshots - No Replies

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