Raised This Month: $ Target: $400
 0% 

im new with a couple of questions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shockdoN
Junior Member
Join Date: Jun 2005
Old 06-01-2005 , 23:54   im new with a couple of questions
Reply With Quote #1

Hey guys, the topic says it all, im getting into coding in small/amx plugins after my take with PHP/MySQL/HTML/ect ect, I have a few questions before coding some real plugins though. I've been reading up on how to code amx plugins using small for awhile now but still dont exactly understand how to register a command that would be activiated in messagemode1, as in a pug system would use .ready/.notready in messagemode1. I only see console command registering from the documents and what not, and the second question would be how can I set the access rights to just plain public so anyone can use the command, and finally, whats a good access to use if im having the connecting user's steamid checked through a MySQL database to see if their a member. Should I maybe make in the database a column access, and then read their steamid + access for that steamid and then make a variable to react as the access? I dont know guys! Im so lost, hopefully you guys are friendly and help the new guy out
shockdoN is offline
slurpycof
Senior Member
Join Date: Nov 2004
Old 06-02-2005 , 00:58  
Reply With Quote #2

Code:
public plugin_init(){ register_clcmd("say","check_ready",-1,"Check for ready/not ready" } public check_ready(id, level, cid){     new message [192]     read_args(message, 190)     remove_quotes(message)     if (containi(message,".notready")!=-1) {         //do something         return PLUGIN_HANDLED     }else if(containi(message,".ready")!=-1){         //do something else         return PLUGIN_HANDLED     }     return PLUGIN_CONTINUE }

You can use admin_sql.amxx instead of re-creating it yourself
slurpycof is offline
shockdoN
Junior Member
Join Date: Jun 2005
Old 06-02-2005 , 19:01  
Reply With Quote #3

alright, thanks alot, one more question though if you're willing to answer. How would I go about enabling what is said after first word check, for example in your coding it checks to see if the word said is either .ready/.notready and then goes to the function, how would i go about like .stats enable/.stats disable ? :/
shockdoN is offline
shockdoN
Junior Member
Join Date: Jun 2005
Old 06-02-2005 , 19:25  
Reply With Quote #4

wait, i should just use read_argc's right?;o
shockdoN is offline
WaZZeR++
Veteran Member
Join Date: Mar 2005
Location: Sweden
Old 06-03-2005 , 10:02  
Reply With Quote #5

or just chech the hole string ".stats enable" and ".stats disable"
or another way:
Code:
if (containi(message,".stats")!=-1) {     if (containi(message,"enable")!=-1) {         //do the thing         return PLUGIN_HANDLED     }else if (containi(message,"disable")!=-1) {         //do the thing         return PLUGIN_HANDLED     }     return PLUGIN_HANDLED     }
WaZZeR++ is offline
Send a message via MSN to WaZZeR++
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 16:50.


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