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
__________________