SA-MP Forums Archive
2 errors - 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: 2 errors (/showthread.php?tid=464212)



2 errors - FaceTutorialz - 15.09.2013

Okay, from what I see, there shouldn't be a problem with this very simple credits command. Here is the command

pawn Код:
#include <a_samp>

if(strcmp("/credits", cmdtext, true, 10) == 0
{
SendClientMessage(playerid, -1, "Skyrocket (Scripter) MixMatch (Mapper)");
return 1;
}
I also did the same with ZCMD.

Error:
Код:
C:\Users\dakota pittman\Desktop\samp03z_sv\filterscripts\credits.pwn(3) : error 010: invalid function or declaration
C:\Users\dakota pittman\Desktop\samp03z_sv\filterscripts\credits.pwn(6) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.



Re: 2 errors - Konstantinos - 15.09.2013

STRCMP:
pawn Код:
#include <a_samp>

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/credits", true))
    {
        SendClientMessage(playerid, -1, "Skyrocket (Scripter) MixMatch (Mapper)");
        return 1;
    }
    return 0;
}
ZCMD:
pawn Код:
#include <a_samp>
#include <zcmd>

CMD:credits(playerid, params[])
{
    SendClientMessage(playerid, -1, "Skyrocket (Scripter) MixMatch (Mapper)");
    return 1;
}



Re: 2 errors - EiresJason - 15.09.2013

You have to put it under this;

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp("/credits", cmdtext, true))
{
SendClientMessage(playerid, -1, "Skyrocket (Scripter) MixMatch (Mapper)");
return 1;
}



Re: 2 errors - alanhutch - 15.09.2013

Try this:
pawn Код:
if(strcmp(cmd, "/credits", true) == 0)
{
SendClientMessage(playerid, -1, "Skyrocket (Scripter) MixMatch (Mapper)");
return 1;
}
And insert this under OnPlayerCommandText


Re: 2 errors - FaceTutorialz - 15.09.2013

Okay, I get 1 more error when I converted it to ZCMD, because ZCMD is better than strcmp.

pawn Код:
#include <a_samp>
#include <zcmd>

#define COLOR_ORANGE 0xFF9900AA

public OnPlayerCommandText(playerid, cmdtext[])

CMD:credits(playerid, params[])
{
SendClientMessage(playerid, COLOR_ORANGE, "Credits: Skyrocket (Scripter) and MixMatch (Mapper)");
return 1;
}
Error:
Код:
C:\Users\dakota pittman\Desktop\samp03z_sv\filterscripts\credits.pwn(8) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: 2 errors - Konstantinos - 15.09.2013

pawn Код:
#include <a_samp>
#include <zcmd>

#define COLOR_ORANGE 0xFF9900AA

CMD:credits(playerid, params[])
{
    SendClientMessage(playerid, COLOR_ORANGE, "Credits: Skyrocket (Scripter) and MixMatch (Mapper)");
    return 1;
}
Removed that line:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])



Re: 2 errors - FaceTutorialz - 15.09.2013

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
pawn Код:
#include <a_samp>
#include <zcmd>

#define COLOR_ORANGE 0xFF9900AA

CMD:credits(playerid, params[])
{
    SendClientMessage(playerid, COLOR_ORANGE, "Credits: Skyrocket (Scripter) and MixMatch (Mapper)");
    return 1;
}
Removed that line:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
Thanks it worked, +REP.