Raised This Month: $12 Target: $400
 3% 

Hlds vs Rehlds


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 11-05-2020 , 17:08   Hlds vs Rehlds
Reply With Quote #1

I really didn't know they are different in scripting.
today i made simple plugin for give/take/set money and it's working on hlds but when i tested it on rehlds didn't work.
Did message mode work on rehlds or not !!???

Working only on hlds !!!!!

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <cstrike> #define PLUGIN "Gold Control" #define VERSION "0.0.1" #define AUTHOR "Supremache" new szTargetId[32]; new iGiveTarget[32]; new iSetTarget[32]; new iTakeTarget[32]; public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_clcmd("say /gold", "cmdGoldSystem")     register_clcmd("GiveAmount", "GiveAmountMessageModeHandler");     register_clcmd("SetAmount", "SetAmountMessageModeHandler");     register_clcmd("TakeAmount", "TakeAmountMessageModeHandler");     // Add your code here... } public cmdGoldSystem(id) {     new iPlayerMenu = menu_create("\yGold System\r: Choose a player", "GoldHandler");     new iPlayers[32],         iNum,         szUserID[32],         szUserName[32];         get_players(iPlayers, iNum, "ch");         for(new iPlayer, i; i < iNum; i++) {         iPlayer = iPlayers[i];         get_user_name( iPlayer, szUserName, charsmax(szUserName));         num_to_str(get_user_userid(iPlayer), szUserID, charsmax(szUserID));         menu_additem(iPlayerMenu, szUserName, szUserID);     }     menu_display(id, iPlayerMenu); } public GoldHandler(id, iPlayerMenu, iItem) {     if(iItem != MENU_EXIT) {         new iAccess,             szData[6],             szName[32],             iCallback,             iUserID,             iPlayer;         menu_item_getinfo(iPlayerMenu, iItem, iAccess, szData, charsmax(szData), szName, charsmax(szName), iCallback);                 iUserID = str_to_num( szData );         iPlayer = find_player( "k", iUserID );                 ChoosePlayer( id, iPlayer );     }     menu_destroy(iPlayerMenu);     return PLUGIN_HANDLED; } public ChoosePlayer( id, Choosen ) {     new iMainMenu,         szData[ 128 ],         szChoosen[ 5 ],         szUserName[32];         get_user_name( Choosen, szUserName, charsmax(szUserName));     formatex( szData, charsmax(szData), "Chose which option do ^nyou want to use on this player: \r%s", szUserName);     iMainMenu = menu_create( szData, "Player_Handler" );         num_to_str( Choosen, szChoosen, charsmax( szChoosen ) );            formatex(szData, charsmax(szData), "Give Golds");     menu_additem(iMainMenu, szData, szChoosen);     formatex(szData, charsmax(szData), "Set Golds");     menu_additem(iMainMenu, szData, szChoosen);     formatex(szData, charsmax(szData), "Take Golds");     menu_additem(iMainMenu, szData, szChoosen);     menu_display( id, iMainMenu );     return PLUGIN_HANDLED; } public Player_Handler(id, iPlayerMenu, iItem) {     if(iItem != MENU_EXIT) {         new iAccess, iCallBack;         menu_item_getinfo(iPlayerMenu, iItem, iAccess, szTargetId, charsmax(szTargetId), _, _, iCallBack);                 switch(iItem) {             case 0: client_cmd(id, "messagemode GiveAmount");             case 1: client_cmd(id, "messagemode SetAmount");             case 2: client_cmd(id, "messagemode TakeAmount");         }     }     menu_destroy(iPlayerMenu); } public GiveAmountMessageModeHandler(id) {     new iUserId = str_to_num(szTargetId);     iGiveTarget[id] = find_player("k", iUserId);         new szUserName[32], szTargetName[32]     if(iGiveTarget[id] && is_user_connected(iGiveTarget[id])) {         new szInput[32], iAmount;         read_argv(1, szInput, charsmax(szInput));         iAmount = str_to_num(szInput);                 if(iAmount > 0) {             cs_set_user_money(iGiveTarget[id], cs_get_user_money(iGiveTarget[id]) + iAmount);             get_user_name( id, szUserName, charsmax(szUserName));             get_user_name( iGiveTarget[id], szTargetName, charsmax(szTargetName));                         client_print( 0, print_chat, "[ADMIN] %s gave %d gold for %s", szUserName, iAmount, szTargetName)         }     } } public SetAmountMessageModeHandler(id) {     new iUserId = str_to_num(szTargetId);     iSetTarget[id] = find_player("k", iUserId);         new szUserName[32], szTargetName[32]     if(iSetTarget[id] && is_user_connected(iSetTarget[id])) {         new szInput[32], iAmount;         read_argv(1, szInput, charsmax(szInput));         iAmount = str_to_num(szInput);                 if(iAmount >= 0) {             cs_set_user_money(iSetTarget[id], iAmount);             get_user_name( id, szUserName, charsmax(szUserName));             get_user_name( iSetTarget[id], szTargetName, charsmax(szTargetName));                         client_print( 0, print_chat, "[ADMIN] %s set %d gold for %s", szUserName, iAmount, szTargetName)         }     } } public TakeAmountMessageModeHandler(id) {     new iUserId = str_to_num(szTargetId);     iTakeTarget[id] = find_player("k", iUserId);         new szUserName[32], szTargetName[32]     if(iTakeTarget[id] && is_user_connected(iTakeTarget[id])) {         new szInput[32], iAmount;         read_argv(1, szInput, charsmax(szInput));                 get_user_name( id, szUserName, charsmax(szUserName));         get_user_name( iGiveTarget[id], szTargetName, charsmax(szTargetName));         iAmount = str_to_num(szInput);                 if(iAmount > 0) {             if( iAmount >= cs_get_user_money(iTakeTarget[id]) ) {                 cs_set_user_money(iTakeTarget[id], 0);                 client_print( 0, print_chat, "[ADMIN] %s take all golds from %s", szUserName, iAmount, szTargetName)                }             else {                 cs_set_user_money(iTakeTarget[id], cs_get_user_money(iGiveTarget[id]) - iAmount);                 client_print( 0, print_chat, "[ADMIN] %s take %d gold from %s", szUserName, iAmount, szTargetName)             }         }     } }
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.

Last edited by Supremache; 11-05-2020 at 18:12.
Supremache is offline
Old 11-05-2020, 18:24
JocAnis
This message has been deleted by asherkin.
Old 11-05-2020, 18:28
Supremache
This message has been deleted by asherkin.
r0ma
Senior Member
Join Date: Apr 2012
Location: Great Tomb of Nazarick
Old 11-05-2020 , 18:43   Re: Hlds vs Rehlds
Reply With Quote #2

on rehlds try reapi rg_add_account

btw about the messagemode idk
__________________
Discord:FluffyDeveloper#4753
Github: https://github.com/francoromaniello
AMX-ES: https://amxmodx-es.com/r0ma'

Last edited by r0ma; 11-05-2020 at 19:23.
r0ma is offline
Send a message via MSN to r0ma
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 11-05-2020 , 19:05   Re: Hlds vs Rehlds
Reply With Quote #3

there's only this way to make this plugin work or i have to change style of codes ??
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
Mankled
Senior Member
Join Date: Oct 2019
Old 11-05-2020 , 22:57   Re: Hlds vs Rehlds
Reply With Quote #4

Quote:
Originally Posted by Supremache View Post
there's only this way to make this plugin work or i have to change style of codes ??
if u are steam player, valve blocked some commands to be executed by a server on a player, one of them is messagemode. why they blocked? to prevent servers from slow hacking clients.
Mankled is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-05-2020 , 23:08   Re: Hlds vs Rehlds
Reply With Quote #5

messagemode is a client-side concept only and has nothing to do with the server (in any direct manner). According to the list of blocked commands via cl_filterstuffcmd, it's not blocked by it.

My advice is to always just use the official HLDS.
__________________

Last edited by fysiks; 11-05-2020 at 23:08.
fysiks is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 11-05-2020 , 23:10   Re: Hlds vs Rehlds
Reply With Quote #6

Quote:
Originally Posted by Mankled View Post
if u are steam player, valve blocked some commands to be executed by a server on a player, one of them is messagemode. why they blocked? to prevent servers from slow hacking clients.
I think not because, i didn't see msg on console, as i know when i use slow hacking on steam client i get this msg in console "Server tried to send executed commands" and in this plugin i haven't got that msg !!
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 11-05-2020 , 23:14   Re: Hlds vs Rehlds
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
messagemode is a client-side concept only and has nothing to do with the server (in any direct manner). According to the list of blocked commands via cl_filterstuffcmd, it's not blocked by it.

My advice is to always just use the official HLDS.
So this plugin can't work on rehlds, will work only if i change that style and use another idea!
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.

Last edited by Supremache; 11-05-2020 at 23:38.
Supremache is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-05-2020 , 23:29   Re: Hlds vs Rehlds
Reply With Quote #8

Quote:
Originally Posted by Supremache View Post
So this plugin can't work on rehlds, will work only if i change that style and use something another idea!
I'm not saying it won't work or what is required to make it work. I'm just telling you my opinion about HLDS vs reHLDS.
__________________
fysiks is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 11-05-2020 , 23:34   Re: Hlds vs Rehlds
Reply With Quote #9

Quote:
Originally Posted by fysiks View Post
I'm not saying it won't work or what is required to make it work. I'm just telling you my opinion about HLDS vs reHLDS.
Well.. !
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 11-06-2020 , 08:05   Re: Hlds vs Rehlds
Reply With Quote #10

I think your problem is in szTarget, take this post by example.

https://forums.alliedmods.net/showpo...54&postcount=8
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:28.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode