| Welcome, Guest |
You have to register before you can post on our site.
|
| Forum Statistics |
» Members: 7,634
» Latest member: Lineblack
» Forum threads: 2,341
» Forum posts: 12,280
Full Statistics
|
| Online Users |
There are currently 327 online users. » 0 Member(s) | 325 Guest(s) Bing, Baidu
|
| Latest Threads |
undefined symbol
Forum: Portuguese/Portugu?s
Last Post: leobradoks
2025-10-25, 08:58 PM
» Replies: 1
» Views: 1,580
|
SA:MP Custom Character Li...
Forum: General Discussions
Last Post: Dilshad
2025-10-22, 04:15 PM
» Replies: 0
» Views: 41
|
Anyone got old rp scripts...
Forum: General Discussions
Last Post: Bilal
2025-10-21, 01:02 PM
» Replies: 5
» Views: 5,226
|
Anyone has the SARP Gamem...
Forum: Gamemodes
Last Post: Bilal
2025-10-21, 12:59 PM
» Replies: 0
» Views: 78
|
SARP Gamemode
Forum: Releases
Last Post: Bilal
2025-10-21, 12:58 PM
» Replies: 0
» Views: 57
|
Need To Hire Pawno Coder....
Forum: General Discussions
Last Post: Dilshad
2025-10-21, 06:20 AM
» Replies: 1
» Views: 799
|
Original Godfather
Forum: Pawn Scripting
Last Post: NmE
2025-10-20, 11:48 AM
» Replies: 3
» Views: 244
|
What would you start?
Forum: Life
Last Post: vuongtrungnu13
2025-10-20, 01:55 AM
» Replies: 4
» Views: 9,843
|
People who have one of th...
Forum: Tech
Last Post: vuongtrungnu13
2025-10-20, 01:39 AM
» Replies: 2
» Views: 5,182
|
After School Community
Forum: Advertisements
Last Post: cosminupgaming
2025-10-19, 12:42 PM
» Replies: 0
» Views: 114
|
|
|
| [HELP]How to Retrieve and Use Values from MySQL Database in SA-MP Server? |
|
Posted by: dudungariska - 2025-01-05, 10:23 PM - Forum: Pawn Scripting
- Replies (1)
|
 |
Hi everyone,
Hi, I’m trying to make a UCP system for my SA-MP roleplay server, but I’m really new to this, and I’m stuck. My idea is that players will register on a website outside the game, and the website will save their data (like username and email) into a MySQL database. When they join the game, I want the server to get that data (like their email) and show it in something like a dialog or a
/stats command. I don’t really understand how to make the server read the data from the database and display it in-game. Can someone explain how to do this step by step?
Here’s what I’m trying to achieve:
- Retrieve Data: How can I fetch the player’s email from the MySQL database when they log in?
- Display Data: How do I show the retrieved email in a dialog or a command (like/stats)?
- Syncing: What’s the best way to ensure that the data in the database matches the player in-game?
I’m using XAMPP for the database and the MySQL plugin for SA-MP. If anyone has example scripts, explanations, or best practices for linking the UCP with the SA-MP server, I’d greatly appreciate it!
Thanks in advance!
|
|
|
|
Help with a loop |
|
Posted by: Neckiy - 2025-01-05, 03:47 PM - Forum: Pawn Scripting
- Replies (3)
|
 |
So I feel very stupid right now but can somebody help me with this problem.
I'm making a loop which loads the mysql database data for my admin system.
Code: #define MAX_ADMINS 25
public OnGameModeInit() {
handle = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE);
new query[128];
for(new i = 0; i < MAX_ADMINS; i++) {
mysql_format(handle, query, sizeof(query), "SELECT * FROM admini WHERE Slot='%d'", i);
mysql_tquery(handle, query, "OnAdminLoad", "i", i);
}
return 1;
}
forward OnAdminLoad(i);
public OnAdminLoad(i) {
if(cache_num_rows() > 0) {
cache_get_value(0, "Ime", AdminInfo[i+1][aIme], 25); // THIS IS WHERE THE ERROR OCCURS
cache_get_value_int(0, "MinNeaktivnost", AdminInfo[i+1][aMinNeaktivnost]);
cache_get_value_int(0, "Neaktivnost", AdminInfo[i+1][aNeaktivnost]);
cache_get_value_int(0, "Zauzeto", AdminInfo[i+1][aZauzeto]);
cache_get_value_int(0, "Level", AdminInfo[i+1][aLevel]);
cache_get_value(0, "ImeLevel", AdminInfo[i+1][aImeLevel], 32);
} else {
print("Ucitavanje Admin Databaze nije uspelo.");
}
return true;
}
The error I get is:
[debug] Run time error 4: "Array index out of bounds"
[2025-01-05T16:46:11+0100] [Info] [debug] Attempted to read/write array element at index 25 in array of size 25
[2025-01-05T16:46:11+0100] [Info] [debug] AMX backtrace:
[2025-01-05T16:46:11+0100] [Info] [debug] #0 000243c8 in public OnAdminLoad (i=24) at C:\Users\neman\Desktop\openmp server\gamemodes\skripta.pwn:120
Even though the loop loops from 0 to 24 and then I load it "i+1" because in my database, the Admin Slots are from 1 to 25?
Can somebody explain where the problem is?
|
|
|
|
| SAMP/OMP Discord - Help us hit 35k users! |
|
Posted by: Potassium - 2025-01-05, 09:52 AM - Forum: General Discussions
- No Replies
|
 |
Hi all,
I think most of us are in the Discord server already, but thought I would remind everyone on the forums that it exists just in case :)
Our Discord server has:
👥 Almost 35,000 users
- A good combination of veteran SA-MP players and new players - find old friends who you used to play with, and make new ones!
- Players from all different servers and all different countries - lots of old players from popular servers!
- SA-related channels
- Casual/off-topic chat channels
- VIP channels
- Channels to showcase your creations (both SA and non-SA!)
- open.mp development log channel
- Server advertisements
- Dedicated channels for each spoken language to meet people from your own countries
📰 The most up-to-date information on open.mp
- Announcements
- News and updates
- Releases
- Development log
- Real-time feedback from open.mp partners
🆘 Support channels
- open.mp support
- SA-MP support
- GTA SA support
- Pawn/scripting support
- Other software dev support
- Tech support
Come and hang out! :)
http://discord.com/samp
|
|
|
|
| Open Roleplay | AI Actors (2.0) |
|
Posted by: Corne - 2025-01-03, 06:31 PM - Forum: Videos and Screenshots
- No Replies
|
 |
Started out with some actors that had the ability to talk back to the player like in this video:
[Video: https://www.youtube.com/watch?v=ZoWpUR5I7V8]
Now, in the latest update, the actors can also use commands such as /me and /do to roleplay, and they can also interact with other actors. It needs more work to be stable, but for now I'm using it to make the login/registration screen more interesting.
[Video: https://www.youtube.com/watch?v=RMHRkCpbA9A]
Right now, it's still a work in progress, I'm not confident enough to let players interact with it because it is still somewhat unstable and can break down and become gibberish (even now it still isn't always perfect), but if I can get this to a more stable state, I could see so many interesting possibilities for interactions with actors/NPCs, especially in a roleplay setting. Imagine going to the store and literally telling the actor what you want, or going to a car dealership and talking to the salesman, or even needing to do an actual interview for a job, and the actor can hire you based on that interview. So many possibilities.
|
|
|
|
| Toggleable HUD / Underground MP changes |
|
Posted by: Corne - 2025-01-01, 09:52 PM - Forum: Questions and Suggestions
- Replies (1)
|
 |
So, my main suggestion was that it would be very nice to be able to toggle the HUD (cash, health, weapon, minimap, etc). Underground Multiplayer has done this in the past as an extension to SA-MP as well.
But then I was thinking, while we're at it, why not look into all the changes that Underground MP did? Other changes like being able to give cars any color you want are pretty amazing too. Has there ever been any communication from the Open MP team with the former Underground MP dev team about this?
It would/could break compatibility with SA-MP clients, but this could be a config setting like 0.3.7 compatibility, right?
|
|
|
|
| Open Roleplay | Biome Generator V3 |
|
Posted by: Corne - 2025-01-01, 09:24 PM - Forum: Videos and Screenshots
- No Replies
|
 |
I've posted some videos and photos of this in the past, but after many years I've picked up on this project again for my upcoming roleplaying server.
Current history so far:
V1: Was written in PAWN, world generation took 30 - 60 minutes and during that time you couldn't join the server.
V2: Was written in .NET using spaghetti code, world generation took roughly 15 minutes and during that time you could play on the server and see it happen in front of you, see Young Fir Forest & Dense Fir Forest video.
V3: Fully refactored the code in .NET and made it organized, clean and now partially supports multi-threading. World generation now takes roughly 100 seconds, does give a bit of a lag spike on the server while it is generating.
Little disclaimer: This is not yet actually for the entire world. Red County and Whetstone are near fully implemented, Flint County and Bone County still have to be done. I also have plans to add way more biomes in the future, and even underwater biomes, all of which will increase the generation time.
[Video: https://www.youtube.com/watch?v=fF0cSdKCPnw]
[Video: https://www.youtube.com/watch?v=0Q5gp7N4M0M]
[Video: https://www.youtube.com/watch?v=KvREbFi6sb0]
[Video: https://www.youtube.com/watch?v=c5YGdkrZHsE]
I also have plans for a V4 in the future. I believe I can get the world generation time down even more, but for now I am satisfied and working on other more important features for the server. The biome generator is not just meant to be a gimmick but have an actual purpose for RPG elements like crafting, gathering, hunting, woodcutting, mining, etc.
|
|
|
|
|