#1

Hello, iam trying to make a command like

/query Loinal level 10
or
/query Loinal kills 9

iam a bit confused idk how can i make that any tips??

PHP код:
CMD:query(playeridparams[])
{
    new 
option[20];
    if(
sscanf(params,"s[24]si"))
    {
        return 
SendClientMessage(playeridCOLOR_YELLOW"USAGE: /query [Account] [coloumn] [Value]");
    }
    if(!
strcmp(option"level"true))
    {
        return 
1;
    }
    if(!
strcmp(option"kills"true))
    {
        return 
1;
    }
    return 
1;

Im using mysql R41-2
Reply
#2

limit the second string in your sscanf and pass the parameters of vars to store data in them to sscanf.
->
PHP код:
CMD:query(playeridparams[]) 

    new 
username[MAX_PLAYER_NAME],option[20],value
    if(
sscanf(params,"s[26]s[20]i",username,option,value)) 
    { 
        return 
SendClientMessage(playeridCOLOR_YELLOW"USAGE: /query [Account] [coloumn] [Value]"); 
    } 
    if(!
strcmp(option"level"true)) 
    { 
        return 
1
    } 
    if(!
strcmp(option"kills"true)) 
    { 
        return 
1
    } 
    return 
1

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)