SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 21/11/2018, 02:40 PM   #1
andrey1311
Little Clucker
 
andrey1311's Avatar
 
Join Date: Jun 2012
Posts: 40
Reputation: 0
Default Commands error

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

PHP Code:
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 Code:
pawno\include\zcmd.inc(96) : warning 217loose indentation
pawno
\include\zcmd.inc(97) : warning 217loose indentation
pawno
\include\zcmd.inc(98) : warning 217loose indentation 
andrey1311 is offline   Reply With Quote
Old 21/11/2018, 03:32 PM   #2
FedeA
Banned
 
Join Date: Oct 2015
Location: Montevideo, Uruguay
Posts: 23
Reputation: 11
Default Re: Commands error

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.
FedeA is offline   Reply With Quote
Old 21/11/2018, 03:40 PM   #3
andrey1311
Little Clucker
 
andrey1311's Avatar
 
Join Date: Jun 2012
Posts: 40
Reputation: 0
Default Re: Commands error

Quote:
Originally Posted by FedeA View Post
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 Code:
        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...
andrey1311 is offline   Reply With Quote
Old 21/11/2018, 04:21 PM   #4
SeeNN
Big Clucker
 
SeeNN's Avatar
 
Join Date: Sep 2017
Location: Craiova
Posts: 119
Reputation: 1
Post Re: Commands error

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

HTML Code:
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; 
}
SeeNN is offline   Reply With Quote
Old 21/11/2018, 04:39 PM   #5
FedeA
Banned
 
Join Date: Oct 2015
Location: Montevideo, Uruguay
Posts: 23
Reputation: 11
Default Re: Commands error

Quote:
Originally Posted by andrey1311 View Post
PHP Code:
        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

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

Code:
    	format(funcname, sizeof(funcname), "cmd_%s", funcname); 
    	while (cmdtext[pos] == ' ') pos++; 
    	if (!cmdtext[pos])
FedeA is offline   Reply With Quote
Old 21/11/2018, 05:25 PM   #6
andrey1311
Little Clucker
 
andrey1311's Avatar
 
Join Date: Jun 2012
Posts: 40
Reputation: 0
Default Re: Commands error

Quote:
Originally Posted by FedeA View Post
Put it like this

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

Code:
    	format(funcname, sizeof(funcname), "cmd_%s", funcname); 
    	while (cmdtext[pos] == ' ') pos++; 
    	if (!cmdtext[pos])
the commands are still not working
andrey1311 is offline   Reply With Quote
Old 21/11/2018, 06:24 PM   #7
d3Pedro
Huge Clucker
 
Join Date: Apr 2012
Location: Los Santos
Posts: 250
Reputation: 80
Default Re: Commands error

Try this out

pawn Code:
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
d3Pedro is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Commands error ! Crazydriver Scripting Help 11 20/10/2014 05:12 PM
Commands Error Message Error se7evolution Scripting Help 2 22/01/2013 08:26 PM
fatal error 107: too many error messages on one line[Commands] Jason_Dino Scripting Help 23 26/10/2012 05:44 PM
An error has occured. (Error ID: 2014, Commands out of sync; you can't run this command now) Tom_Dedi Help Archive 3 07/11/2010 01:01 PM
Commands Error :S GforceNL Help Archive 6 16/08/2009 03:02 PM


All times are GMT. The time now is 04:56 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.