Commands error
#1

Hi! So I made some commands for my server and none of them are working. Here's a command :

PHP код:
CMD:me(playeridparams[])
{
    if(!
LoggedIn[playerid]) return 1;
    
    if(
isnull(params)) return SendClientMessage(playeridCOLOR_RED"USE:: /me [action]");
    new 
string[128];
    
format(stringsizeof(string), "* %s %s"NameRP(playerid), params);
    
SendLocalMessage(playeridCOLOR_EMOTEstring);
    return 
1;

When I'm compiling the script I get some warnings from ZCMD :

PHP код:
pawno\include\zcmd.inc(96) : warning 217loose indentation
pawno
\include\zcmd.inc(97) : warning 217loose indentation
pawno
\include\zcmd.inc(98) : warning 217loose indentation 
Reply
#2

Seems to be a problem with your ZCMD include file, which version are you using?

Send that part of the include if you can, or update it.
Reply
#3

Quote:
Originally Posted by FedeA
Посмотреть сообщение
Seems to be a problem with your ZCMD include file, which version are you using?

Send that part of the include if you can, or update it.
PHP код:
        format(funcnamesizeof(funcname), "cmd_%s"funcname);
    while (
cmdtext[pos] == ' 'pos++;
        if (!
cmdtext[pos]) 
I tried now with the zcmd from southclaws and still not working...
Reply
#4

Try something like that,I do not know if work,but,try...

Код HTML:
CMD:me(playerid, params[]) 
{ 
    if(!LoggedIn[playerid]) return 1; 
    {
 
      if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "USE:: /me [action]"); 
      //-----------------------------------------------------------------------------------
      new string[128]; 
      format(string, sizeof(string), "* %s %s", NameRP(playerid), params); 
      SendLocalMessage(playerid, COLOR_EMOTE, string); 
    }
    return 1; 
}
Reply
#5

Quote:
Originally Posted by andrey1311
Посмотреть сообщение
PHP код:
        format(funcnamesizeof(funcname), "cmd_%s"funcname);
    while (
cmdtext[pos] == ' 'pos++;
        if (!
cmdtext[pos]) 
I tried now with the zcmd from southclaws and still not working...
Put it like this

Код:
    format(funcname, sizeof(funcname), "cmd_%s", funcname); 
    while (cmdtext[pos] == ' ') pos++; 
    if (!cmdtext[pos])
If above doesn`t work, use this:

Код:
    	format(funcname, sizeof(funcname), "cmd_%s", funcname); 
    	while (cmdtext[pos] == ' ') pos++; 
    	if (!cmdtext[pos])
Reply
#6

Quote:
Originally Posted by FedeA
Посмотреть сообщение
Put it like this

Код:
    format(funcname, sizeof(funcname), "cmd_%s", funcname); 
    while (cmdtext[pos] == ' ') pos++; 
    if (!cmdtext[pos])
If above doesn`t work, use this:

Код:
    	format(funcname, sizeof(funcname), "cmd_%s", funcname); 
    	while (cmdtext[pos] == ' ') pos++; 
    	if (!cmdtext[pos])
the commands are still not working
Reply
#7

Try this out

pawn Код:
CMD:me(playerid, params[])
{
    if(!LoggedIn[playerid])
    {
        return SendClientMessage(playerid, -1, "You must be logged in to use this command");
    }
    if(isnull(params))
    {
        return SendClientMessage(playerid, COLOR_RED, "USE:: /me [action]");
    }
    else
    {
        new string[128];
        format(string, sizeof(string), "* %s %s", NameRP(playerid), params);
        SendLocalMessage(playerid, COLOR_EMOTE, string);
    }
    return 1;
}
If it still doesn't work try out Pawn.CMD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)