SA-MP Forums Archive
strcmp to zcmd failure, undefined symbol - 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: strcmp to zcmd failure, undefined symbol (/showthread.php?tid=446408)



strcmp to zcmd failure, undefined symbol - iVk - 25.06.2013

So I just converted all my strcmp commands to zcmd but I'm having some problems, everytime I try to compile it says:

Код:
error 029: invalid expression, assumed zero
error 017: undefined symbol "cmd_day"
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.
Top of my script
Код:
#include <zcmd>
The command:
Код:
public OnPlayerSpawn(playerid)
{
CMD:day(playerid, params[])
{
	SetPlayerTime(playerid,12,0);
	SendClientMessage(playerid, yellow, "Its Day For You.");
	return 1;
}
I think it shouldn't be under OnPlayerSpawn but it gives errors no matter where I put it


Re: strcmp to zcmd failure, undefined symbol - Zeyo - 25.06.2013

Actually, zcmd commands are like functions. You define them like this:
Код:
public OnPlayerSpawn(playerid)
{
   //code when player SPAWNS
   return 1;
}

CMD:day(playerid, params[]) //Your command
{
	SetPlayerTime(playerid, 12, 0);
	SendClientMessage(playerid, yellow, "Its Day For You.");
	return 1;
}



Re: strcmp to zcmd failure, undefined symbol - iVk - 26.06.2013

I just did that and it's still the same error

Код:
error 017: undefined symbol "cmd_day"



Re: strcmp to zcmd failure, undefined symbol - Weaselpwns - 26.06.2013

Try this under your defines:


pawn Код:
#define cmd_day



Re: strcmp to zcmd failure, undefined symbol - iVk - 26.06.2013

Quote:
Originally Posted by Weaselpwns
Посмотреть сообщение
Try this under your defines:


pawn Код:
#define cmd_day
The compiler crashed after I did that