SA-MP Forums Archive
CMD 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: CMD Errors (/showthread.php?tid=320061)



CMD Errors - F9 - 21.02.2012

Hello,
I'm using the SPU[Special Police Units] FS, and I defined "zcmd" and changed the /spu command to ZCMD, and I get these errors:
Код:
error 029: invalid expression, assumed zero
error 017: undefined symbol "cmd_spu"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Here's the command:
Код:
CMD:spu(playerid, params[])
{
	if(GetPlayerSkin(playerid) != 280 && GetPlayerSkin(playerid) != 281 && GetPlayerSkin(playerid) != 282 && GetPlayerSkin(playerid) != 283 && GetPlayerSkin(playerid) != 284 && GetPlayerSkin(playerid) != 285 && GetPlayerSkin(playerid) != 286 && GetPlayerSkin(playerid) != 287 && GetPlayerSkin(playerid) != 288)
	{
		ShowPlayerDialog(playerid, 1123, DIALOG_STYLE_LIST, "So you want to have a SPU, what one do you want then?", DIALOG1_MSG, "Take it", "Leave it" );
	}
	else
	{
 		SendClientMessage(playerid, COLOR_RED, "You need to be in the Police Force to beable to use this.");
	}
	return 1;
}



Re: CMD Errors - Konstantinos - 21.02.2012

I can't understand what exactly do you want to make.
Also, about the error, make sure you have zcmd.inc in the pawno\includes folder and defined at the script
pawn Код:
#include < a_samp >
#include < zcmd >
About the command, it says that if the skin is different from 280 and 281 and ... 288, that players want to have a SPU, else if the skin IDs are the numbers above he isn't Police Force


Re: CMD Errors - niels44 - 21.02.2012

yes change it to what dwane said and also if you used dcmd in this script before then remove the dcmd define or else you could get buggs/errors XD


Re: CMD Errors - F9 - 21.02.2012

Right, Download the SPU Filterscript and you will see, it was using the STRCMP thing as the command, and I added the inlclude "#include <zcmd>" and then I Changed it to ZCMD and I get those errors.


Re: CMD Errors - Konstantinos - 21.02.2012

I am not able to download right now. Just show me the command in strcmp and I will convert it to ZCMD.


Re: CMD Errors - niels44 - 21.02.2012

weird... becuz when i copy the cmd into my script and compile it then i dont get ANY errors...


Re: CMD Errors - F9 - 21.02.2012

Could it be something like this?
Код:
public OnPlayerCommandText(playerid, cmdtext[]) {
CMD:fbi(playerid, params[])
{
	if(GetPlayerSkin(playerid) != 280 && GetPlayerSkin(playerid) != 281 && GetPlayerSkin(playerid) != 282 && GetPlayerSkin(playerid) != 283 && GetPlayerSkin(playerid) != 284 && GetPlayerSkin(playerid) != 285 && GetPlayerSkin(playerid) != 286 && GetPlayerSkin(playerid) != 287 && GetPlayerSkin(playerid) != 288)
	{
		ShowPlayerDialog(playerid, 1123, DIALOG_STYLE_LIST, "So you want to have a SPU, what one do you want then?", DIALOG1_MSG, "Take it", "Leave it" );
	}
	else
	{
 		SendClientMessage(playerid, COLOR_RED, "You need to be in the Police Force to beable to use this.");
	}
	return 1;
}
It's right under OnPlayerCommandText

And here Dwane
Код:
public OnPlayerCommandText(playerid, cmdtext[]) {
CMD:fbi(playerid, params[])
{
	if(GetPlayerSkin(playerid) != 280 && GetPlayerSkin(playerid) != 281 && GetPlayerSkin(playerid) != 282 && GetPlayerSkin(playerid) != 283 && GetPlayerSkin(playerid) != 284 && GetPlayerSkin(playerid) != 285 && GetPlayerSkin(playerid) != 286 && GetPlayerSkin(playerid) != 287 && GetPlayerSkin(playerid) != 288)
	{
		ShowPlayerDialog(playerid, 1123, DIALOG_STYLE_LIST, "So you want to have a SPU, what one do you want then?", DIALOG1_MSG, "Take it", "Leave it" );
	}
	else
	{
 		SendClientMessage(playerid, COLOR_RED, "You need to be in the Police Force to beable to use this.");
	}
	return 1;
}



Re: CMD Errors - emokidx - 21.02.2012

when you use zcmd
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
}
the commands shouldn't be in this callback or any callback


Re: CMD Errors - Konstantinos - 21.02.2012

You can't use it inside any callback.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    return 1;
}
// Outside
CMD:fbi(playerid, params[])
{
    if(GetPlayerSkin(playerid) != 280 && GetPlayerSkin(playerid) != 281 && GetPlayerSkin(playerid) != 282 && GetPlayerSkin(playerid) != 283 && GetPlayerSkin(playerid) != 284 && GetPlayerSkin(playerid) != 285 && GetPlayerSkin(playerid) != 286 && GetPlayerSkin(playerid) != 287 && GetPlayerSkin(playerid) != 288)
    {
        ShowPlayerDialog(playerid, 1123, DIALOG_STYLE_LIST, "So you want to have a SPU, what one do you want then?", DIALOG1_MSG, "Take it", "Leave it" );
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, "You need to be in the Police Force to beable to use this.");
    }
    return 1;
}



Re: CMD Errors - F9 - 21.02.2012

Thanks, but it still works with people without that skin.