Small Help
#1

Code:
public OnPlayerCommandPerformed(cmdid, playerid, cmdtext[], success)
{
	if(!success) return SCM(playerid, COLOR_RED, ""COL_BLUE"[ERROR]: "COL_WHITE"/%s command is not found in our server database, use /help", cmdtext);
	return 1;
}
warning 202: number of arguments does not match definition, i used smartcmd.inc for this one.
Reply
#2

PHP Code:
SCM(playeridCOLOR_RED""COL_BLUE"[ERROR]: "COL_WHITE"/%s command is not found in our server database, use /help"cmdtext); 
I'll suppose SCM is just a #define SCM SendClientMessage and not a function, if that's the case, there's no formatting on SendClientMessage, which means you'll first have to use the format function and then send the formatted message.

https://sampwiki.blast.hk/wiki/SendClientMessage
https://sampwiki.blast.hk/wiki/Format

Structurally it'd be like:

PHP Code:
public OnPlayerCommandPerformed(cmdidplayeridcmdtext[], success)
{
    if(!
success)
    {
        
create a string of a considerable size
        format the string with the message you want
        send the client message with the string 
as the message parameter
        
return the value you think you should
    
}
    return 
1;

Reply
#3

Quote:
Originally Posted by Toroi
View Post
PHP Code:
SCM(playeridCOLOR_RED""COL_BLUE"[ERROR]: "COL_WHITE"/%s command is not found in our server database, use /help"cmdtext); 
I'll suppose SCM is just a #define SCM SendClientMessage and not a function, if that's the case, there's no formatting on SendClientMessage, which means you'll first have to use the format function and then send the formatted message.

https://sampwiki.blast.hk/wiki/SendClientMessage
https://sampwiki.blast.hk/wiki/Format

Structurally it'd be like:

PHP Code:
public OnPlayerCommandPerformed(cmdidplayeridcmdtext[], success)
{
    if(!
success)
    {
        
create a string of a considerable size
        format the string with the message you want
        send the client message with the string 
as the message parameter
        
return the value you think you should
    
}
    return 
1;

Oh yeah, totally forgot about that. Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)