multiple command
#1

Hello, i want to do multiple command,
/clan war [invite/deny/accept]

please help, sorry for my bad english
Reply
#2

hello, you can use zcmd,sscanf

PHP код:
CMD:clan(playeridparams[])
{
    new 
param[20];
    if (
sscanf(params"s[20]"param))
    {
       
SendClientMessage(playerid0xFFFFFFF,"[S]  : /clan  [type]");
       
SendClientMessage(playerid0xFFFFFFF,"[TYPES] [invite/deny/accept]");
       return 
1;
    }
    if (!
strcmp(param"invite"true6))
    {
        
//code here
    
}
    if (!
strcmp(param"deny"true4))
    {
        
//code here
    
}
    if (!
strcmp(param"accept"true6))
    {
        
//code here
    
}
    return 
1;

Reply
#3

yes i use zcmd & sscanf but i want to do /clan WAR [invite/deny/accept] not /clan [invite/deny/accept] or /clanwar [invite/deny/accept]
Reply
#4

You can do that by using strings in sscanf

Ex.
Код:
sscanf(params,"s[128]",invitationtype))
And then use strcmp for comparing if string matches any one of case or you can use numbers for that
Reply
#5

Then add a second parameter, also no need for param to be a size of 20.
pawn Код:
new param[6], option[6];
if(sscanf(params, "s[6]s[6]", param, option))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)