26.06.2016, 10:35
(
Последний раз редактировалось IstuntmanI; 26.06.2016 в 11:53.
)
v3.0 is even better than I expected. Awesome release ! Looking forward to even more new things in future versions (mainly what Crayder suggested, but I don't get why PC_HasFlag is required, if we have PC_GetFlags). I'm converting right now.
By the way, I think that PC_GetFlags should return the flags value instead of having a parameter passed by reference.
EDIT:
Suggestion 1:
Example:
Returns:
true:
- if the source is that command
- if the source is an alias of that command and alias is set to true
false:
- if it is not that command and alias is set to false
- if it is an alias but alias is set to false.
- if it is not that command and not an alias
Suggestion 2:
Example:
Returns:
true:
- if it passes the spelt command succesfully to destination
false:
- if it failed somehow
Suggestion 3:
By the way, I think that PC_GetFlags should return the flags value instead of having a parameter passed by reference.
EDIT:
Suggestion 1:
pawn Код:
native PC_IsCommand( source[ ], command[ ], bool:alias );
pawn Код:
public OnPlayerCommandReceived( ... )
{
if( PC_IsCommand( cmd, "test", false ) ) return 0;
return 1;
}
true:
- if the source is that command
- if the source is an alias of that command and alias is set to true
false:
- if it is not that command and alias is set to false
- if it is an alias but alias is set to false.
- if it is not that command and not an alias
Suggestion 2:
pawn Код:
native PC_SpeltCommand( playerid, destination[ ], maxlength = sizeof destination );
pawn Код:
alias:test( "hello", "there" );
CMD:test( playerid, params[ ] )
{
new string[ 6 ];
PC_SpeltCommand( playerid, string );
printf( "%d wrote '%s' to call the /test command !", playerid, string );
// Possible values: hello, there, test.
return 1;
}
true:
- if it passes the spelt command succesfully to destination
false:
- if it failed somehow
Suggestion 3:
pawn Код:
native PC_CommandsCount( );
native PC_AliasesCount( );
native PC_CommandAliasesCount( cmd[ ] );