CMD Errors
#1

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;
}
Reply
#2

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
Reply
#3

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
Reply
#4

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.
Reply
#5

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

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

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;
}
Reply
#8

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

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;
}
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)