Raised This Month: $ Target: $400
 0% 

Various problems


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
_KaszpiR_
AMX Mod X Beta Tester
Join Date: Feb 2004
Location: Warsaw, Poland
Old 03-11-2004 , 03:16  
Reply With Quote #2

i can post from old amx ones
1. i use this one
Code:
public playtime_say(id){    new speech[192]    new query[33]    read_args(speech,192)    remove_quotes(speech) //   client_print(id,print_console,"[AMX] PlayTime - DEbug s '%s'", speech)    new i = 0    if(equal(speech,"/playtimetop", 12))         playtime_report(id,"",1)    else if(equal(speech,"/playtime", 9))    {      while(speech[10+i]){//copying the rest of the say text as a query text (without /playtime)            query[i] = speech[10+i]            i++      } //      client_print(id,print_console,"[AMX] PlayTime - Debug q '%s'", query)      if(!strlen(query))     get_user_name(id,query,32) //      client_print(id,print_console,"[AMX] PlayTime - Debug q2 '%s'", query)      playtime_report(id,query)    //playtime_report(id,speech[10])    }    return PLUGIN_CONTINUE //the say text can be parsed by other plugins so use plugin_continue }
the say command contains 1 arg - the string after
say "anythign here utill enter pressed"

and in the plugin i get that argument and the check
if it contains /playtime or /playtimetop
if playtimetop -run fuction with different parameters
if playtime and after that there are not text then run funtion with player name partameter (as a query)
otherwise run funtion ith the rest of the string

complete source at http://info.wsisiz.edu.pl/~sochon/do...l_playtime.sma

2. the admin.sma will help you for sure, there are the best examples of finding the players

3. better
new num = get_cvar_num(...)
then round it and finally use switch
here i suggest adminmenu.sma addon
__________________
= Ave Cesar, morituri Te salutant. = http://nvt.prv.pl = http://hlds.pl/
_KaszpiR_ is offline
 



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 09:50.


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