Raised This Month: $ Target: $400
 0% 

register_clcmd with parameter UID


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-28-2017 , 13:21   Re: register_clcmd with parameter UID
Reply With Quote #1

You can bump your topic once every 14 days..

Also search before posting an old solved problem...
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
gameplayonline
Member
Join Date: Jun 2017
Old 06-28-2017 , 13:26   Re: register_clcmd with parameter UID
Reply With Quote #2

i searching but really dont see this anywhere!
gameplayonline is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-28-2017 , 13:42   Re: register_clcmd with parameter UID
Reply With Quote #3

Next time try a bit harder...

https://forums.alliedmods.net/showth...arse+read_args
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
gameplayonline
Member
Join Date: Jun 2017
Old 06-28-2017 , 14:08   Re: register_clcmd with parameter UID
Reply With Quote #4

Thank you a lot...
I do this but it doesnt work...
Code:
	
	uid = 123
	new FullMsg[192], UID[32], Command[32]
    
	read_args( FullMsg, charsmax(FullMsg) )
	strbreak(FullMsg, Command, charsmax(Command), UID, charsmax(UID))
    
	str_to_num(UID)
	if(UID[31] == uid)
	{
		client_print(id, print_chat, "test")    
	}

Last edited by gameplayonline; 06-28-2017 at 14:10.
gameplayonline is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-28-2017 , 15:13   Re: register_clcmd with parameter UID
Reply With Quote #5

PHP Code:
new sString[64]
read_args(sStringcharsmax(sString))
remove_quotes(sString)
new 
szUID[32];
strbreak(sString""szUIDcharsmax(szUID))

new 
UID str_to_num(szUID);
client_print(idprint_chat"%d"UID
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 06-28-2017 , 16:46   Re: register_clcmd with parameter UID
Reply With Quote #6

Code:
#include <amxmodx> #include <amxmisc> public plugin_init() {     register_plugin("Say", "1.0", "PurposeLess")     register_clcmd("say", "clcmd_say")     register_clcmd("say_team", "clcmd_say") } // I didn't change anything above here, it's all good. public clcmd_say(id) {     new text[32] // This is big enough to hold the message with some extra space for flexibility.     read_args(text, charsmax(text)) // Read the contents of the message.     remove_quotes(text) // Remove the quotes.         new command[16], number[16] // New variables to hold the different parts.     strbreak(text, command, charsmax(command), number, charsmax(number)) // Split the text in two using space as a delimiter.     if ( equali(command, "/referral") ) { // Check if the command is correct.         new uid = str_to_num(number) // Convert the number string to an integer         if ( uid ) // You need to check that the uid is actually a number and not 0.             client_print(id, print_chat, "Referral UID: %d", uid)     } }
__________________

Last edited by Black Rose; 06-30-2017 at 09:59.
Black Rose is offline
gameplayonline
Member
Join Date: Jun 2017
Old 06-30-2017 , 12:04   Re: register_clcmd with parameter UID
Reply With Quote #7

Thank you a lot!
gameplayonline is offline
Reply



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 22:44.


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