Welcome, Guest |
You have to register before you can post on our site.
|
Online Users |
There are currently 336 online users. » 0 Member(s) | 334 Guest(s) Google, Bing
|
Latest Threads |
will open.mp supports hig...
Forum: Questions and Suggestions
Last Post: NoxxeR
Yesterday, 07:10 PM
» Replies: 2
» Views: 389
|
black screen
Forum: Support
Last Post: geppetog
Yesterday, 05:34 PM
» Replies: 0
» Views: 17
|
Discord server - Ban Appe...
Forum: Chat
Last Post: joshcoconutard
2025-04-22, 06:42 PM
» Replies: 0
» Views: 32
|
I know Kalcor left the bu...
Forum: Questions and Suggestions
Last Post: NoxxeR
2025-04-22, 02:22 PM
» Replies: 4
» Views: 136
|
Sponsors and Donations
Forum: Questions and Suggestions
Last Post: NoxxeR
2025-04-20, 05:48 AM
» Replies: 0
» Views: 47
|
Best practices for conver...
Forum: Tech
Last Post: Mido
2025-04-19, 09:53 PM
» Replies: 1
» Views: 116
|
What got you into SA-MP a...
Forum: Chat
Last Post: alecnia
2025-04-17, 01:17 AM
» Replies: 1
» Views: 168
|
I would like to know abou...
Forum: General Discussions
Last Post: Wriney
2025-04-15, 07:14 AM
» Replies: 0
» Views: 81
|
Mini Games
Forum: Advertisements
Last Post: Voldy
2025-04-15, 03:59 AM
» Replies: 9
» Views: 1,942
|
help
Forum: Programming
Last Post: J0nathan550
2025-04-14, 06:10 PM
» Replies: 1
» Views: 192
|
|
|
Turfs (formerly gangzones) module |
Posted by: Josh - 2019-10-19, 04:20 PM - Forum: Development Updates
- Replies (13)
|
 |
Hello!
I have just finished our Turf implementation into the server and I thought of posting a overview of this module and to show we haven't quit or anything!
PHP Code: // Creates a Turf. A playerid can be passed in order to make it a player turf.
native Turf:Turf_Create(Float:minx, Float:miny, Float:maxx, Float:maxy, Player:owner = INVALID_PLAYER_ID);
// Destroys a turf.
native Turf_Destroy(Turf:turf);
// Shows a Turf to a player or players.
// Will send to all players if playerid = INVALID_PLAYER_ID.
native Turf_Show(Turf:turf, colour, Player:playerid = INVALID_PLAYER_ID);
// Hides a Turf from a player or players.
// Will send to all players if playerid = INVALID_PLAYER_ID.
native Turf_Hide(Turf:turf, Player:playerid = INVALID_PLAYER_ID);
// Flashes a Turf for a player or players.
// Will send to all players if ?playerid = INVALID_PLAYER_ID.
native Turf_Flash(Turf:turf, colour, Player:playerid = INVALID_PLAYER_ID);
// Stops a Turf from flashing for player(s).
// Will send to all players if playerid = INVALID_PLAYER_ID.
native Turf_StopFlashing(Turf:turf, Player:playerid = INVALID_PLAYER_ID);
This is obviously different from the traditional API, but not to worry, there will be wrappers in place for this kind of stuff to make sure a normal script can be recompiled with no issues and without edits.
Another important fact that you may want to know is that every turf is in the same pool and there's a maximum of 4,294,967,295 turfs to be created from the script.
However, the client can only handle 1024 turfs at one time.
|
|
|
fixes.inc 2019 help? |
Posted by: rooky - 2019-10-09, 02:12 PM - Forum: Pawn Scripting
- Replies (2)
|
 |
@Y-Less, i try your new fixes include but i got some error
i include this, after <a_samp>
Code: #define FIXES_Single 1
#define FIXES_EnableAll
#define FIXES_EnableDeprecated
#include < fixes >
#include < other >
and i got this error
Code: fixes.inc(5737)?error 017: undefined symbol "fopen"
fixes.inc(5737) error 017: undefined symbol "io_read"
can you help me please?
https://github.com/Open-GTO/sa-mp-fixes
|
|
|
Very specific problem regarding file functions and y_hooks |
Posted by: Plastikmensch - 2019-10-09, 10:35 AM - Forum: Pawn Scripting
- No Replies
|
 |
So... I don't really know if it is even script related or a bug with samp, y_hooks or sampctl.
TL;DR: hook of CreateMenu doesn't get called when file functions (fwrite, fread etc..) are also hooked
Problem description:
Setup: 2 local Servers, only difference: server 1 uses sampctl, server 2 doesn't
Exact same code:
include file:
Code: #include <a_samp>
#include <YSI_Coding\y_hooks>
hook function fclose(File:handle)
{
? ?if(handle) return continue(handle);
? ?printf("Invalid handle passed to fclose!");
? ?return ~0;
}
hook function fwrite(File:handle, const string[])
{
? ?if(handle) return continue(handle, string);
? ?printf("Invalid handle passed to fwrite!");
? ?return ~0;
}
hook function fread(File:handle, string[], size = sizeof string, bool:pack = false)
{
? ?if(handle) return continue(handle, string, size, pack);
? ?printf("Invalid handle passed to fread!");
? ?return ~0;
}
hook function fputchar(File: handle, value, bool: utf8 = true)
{
? ?if(handle) return continue(handle, value, utf8);
? ?printf("Invalid handle passed to fputchar!");
? ?return ~0;
}
hook function fgetchar(File: handle, value, bool: utf8 = true)
{
? ?if(handle) return continue(handle, value, utf8);
? ?printf("Invalid handle passed to fgetchar!");
? ?return ~EOF;
}
hook function fblockwrite(File: handle, const buffer[], size = sizeof buffer)
{
? ?if(handle) return continue(handle, buffer, size);
? ?printf("Invalid handle passed to fblockwrite!");
? ?return ~0;
}
hook function fblockread(File: handle, buffer[], size = sizeof buffer)
{
? ?if(handle) return continue(handle, buffer, size);
? ?printf("Invalid handle passed to fblockread!");
? ?return ~0;
}
hook function fseek(File: handle, position = 0, seek_whence:whence = seek_start)
{
? ?if(handle) return continue(handle, position, whence);
? ?printf("Invalid handle passed to fseek!");
? ?return ~0;
}
hook function flength(File: handle)
{
? ?if(handle) return continue(handle);
? ?printf("Invalid handle passed to flength!");
? ?return ~0;
}
hook function CreateMenu(const title[], columns, Float:x, Float:y, Float:col1width, Float:col2width = 0.0)
{
? ?print("hook called");
}
Gamemode:
Code: #include <a_samp>
#include <test>
main()
{
}
public OnGameModeInit()
{
? ?new Menu:test = CreateMenu("Your Menu", 2, 200.0, 100.0, 150.0, 150.0);
? ?return 1;
}
Result server 1: nothing
Result server 2: hook called
When I delete (or comment out) the file hooks in server 1, it prints, but only then.
It doesn't make any difference in server 2.
So... can someone confirm this issue and/or has any solution or any idea why this happens?
I'm out of ideas.
Can provide more information if needed.
(btw. are code tags broken when using formatting?)
//Update:
It works in server 1 when the CreateMenu hook is placed before the file hooks. Still don't know why this happens...
But didn't test yet, if the file hooks are called when switched place.
Will do more tests, after I finish the include, but seems like this isn't a scripting related problem.
If someone wants to move this thread to the appropriate section, I'd be thankful.
On a side note: if(handle) should be if(handle > 0). It's very unlikely a negative handle is passed by accident, but would still crash.
//Update2:
After adding some more hooks, CreateMenu wasn't called again.
I commented out the hook right after it (in this case DestroyMenu) and it got called again.
Oh, and tested file functions and none of them gets called.
So... I still don't know why, but it seems it has nothing to do with the script or hooks itself.
Also should add that I added a print to the gamemode in the meantime to print menuid and it is printing -2 now, which is very odd.
//Update3:
I give up. I can't find out why this happens.
Creating a third server using sampctl, running code works, still not in server 1 (Again same code).
Also it seems random which hook doesn't get called depending on where it's placed.
Can be more precise, but I don't see the point anymore.
Only assumption I can make is that it doesn't even matter what is hooked.
Solved the return of -2: I returned the menuid of created menu and used "return ~menuid", remove "~" and it returns the correct value.
|
|
|
Centos 7 screen help |
Posted by: Salesman - 2019-10-08, 06:26 PM - Forum: Support
- Replies (1)
|
 |
Hello, I try to run my SA-MP server on Centos 7 with screen command but when I try it just says screen terminated it worked before but I had trouble with libstdc but now it doesn't start the server like it should have.
|
|
|
MySQL Weapon save custom |
Posted by: Zow - 2019-09-30, 04:17 PM - Forum: Pawn Scripting
- Replies (1)
|
 |
They saved every weapon from the server after disconnected
But I wants them to custom save
exam: /getgun from the gang = not save
/weapon = save
sorry for my bad explain I don't know how to explain to be clear
PHP Code: public OnPlayerDisconnect(playerid, reason)
{
for (new i = 0; i <= 12; i)
{
? ?GetPlayerWeaponData(playerid, i, weapons1[i][0], weapons1[i][1]);
? ?if(!weapons1[i][0]) continue; // don't insert if there's no weapon in this slot
mysql_format(dbCon, query, sizeof(query), "INSERT INTO `WeaponData` (ID, WeaponID, Ammo) VALUES (%d, %d, %d) ON DUPLICATE KEY UPDATE `Ammo` = `Ammo` %d", PlayerInfo[playerid][pSQLID], weapons1[i][0], weapons1[i][1], weapons1[i][1]);
mysql_query(dbCon, query);
printf("weapon: %d, ammo: %d", weapons1[i][0], weapons1[i][1]);
}
return 1;
}
PHP Code: ?if(strcmp(cmd, "/weapon", true) == 0)
?{
???? GivePlayerWeapon(playerid, 24, 500);
???? GivePlayerWeapon(playerid, 30, 500);
???? GivePlayerWeapon(playerid, 8, 1);
?}
PHP Code: ?if(strcmp(cmd, "/getgun", true) == 0)
?{
???? GivePlayerWeapon(playerid, 24, 500);
???? GivePlayerWeapon(playerid, 30, 500);
???? GivePlayerWeapon(playerid, 8, 1);
?}
|
|
|
Block/reject queries with opcode 'c' using iptables |
Posted by: AdrianBZG - 2019-09-27, 09:03 AM - Forum: Support
- No Replies
|
 |
Hi,
I have seen some servers that even tho they have less than 100 players, the players are not listed in the server browser. This is obviously a measure against UDP query flood to the server.
I was wondering if someone could help me or tell me how to do the exact same thing.
Does this require to block SAMP UDP packets with a specific opcode using iptables, e.g. opcode 63 (flag c), which is the one that gives the players info? See?https://wiki.sa-mp.com/wiki/Query_Mechanism#Opcodes?for info about opcodes.
I tried with this iptables rules, but it's not working, I still get the server info in the server browser:
iptables -I INPUT -p udp --dport 7777 -m string --algo kmp --hex-string '|53414d50|' -m string --algo kmp --hex-string '|611e63|' -j DROP
I'm not sure how to do that, please help.
Thanks.
|
|
|
|