SA-MP Forums Archive
Commands error - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Commands error (/showthread.php?tid=661082)



Commands error - andrey1311 - 21.11.2018

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 



Re: Commands error - FedeA - 21.11.2018

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.


Re: Commands error - andrey1311 - 21.11.2018

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...


Re: Commands error - SeeNN - 21.11.2018

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; 
}



Re: Commands error - FedeA - 21.11.2018

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])



Re: Commands error - andrey1311 - 21.11.2018

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


Re: Commands error - d3Pedro - 21.11.2018

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