[REP+] Gamemode compile error
#1

I have problems with my gamemode. I convert my commands to zcmd, but when I try to compile I get errors.

Quote:

C:\Users\sofie's\Desktop\SKCNRV3\gamemodes\CNR.pwn (3356) : error 029: invalid expression, assumed zero
C:\Users\sofie's\Desktop\SKCNRV3\gamemodes\CNR.pwn (3356) : error 017: undefined symbol "cmd_register"
C:\Users\sofie's\Desktop\SKCNRV3\gamemodes\CNR.pwn (3356) : error 029: invalid expression, assumed zero
C:\Users\sofie's\Desktop\SKCNRV3\gamemodes\CNR.pwn (3356) : fatal error 107: too many error messages on one line

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


4 Errors.

Line 3356 - 3385
Код:
CMD:register(playerid, params[])
	{
	    tmp = strtok(cmdtext, idx);
	    if(strlen(tmp) == 0) return SendClientMessage(playerid, ERROR, "/register [password]");
	    format(file,sizeof(file),"%s.streetkings", name);
	    if(!fexist(file))
		{
			dini_Create(file);
			dini_IntSet(file, "Password", udb_hash(tmp));
			dini_IntSet(file, "Money", 2500);
			dini_IntSet(file, "Score", 1);
			dini_IntSet(file, "Bank", 1000);
			dini_IntSet(file, "RobSkill", 1);
			dini_IntSet(file, "TerSkill", 1);
			dini_IntSet(file, "Admin", 0);
			dini_IntSet(file, "Warnings", 0);
			dini_IntSet(file, "WantedLevel", 0);
			dini_IntSet(file, "Jail", 0);
			dini_IntSet(file, "RentalOwner", 0);
			dini_IntSet(file, "Drugs", 0);
			dini_IntSet(file, "C4", 0);
			dini_IntSet(file, "Skin", -1);
			SendClientMessage(playerid, GREY, "Thanks for registering!");
			SendClientMessage(playerid, GREY, "You may now login.");
			SendClientMessage(playerid, GREY, "To do so, type: /login [PASSWORD]");
			GameTextForPlayer(playerid, "~r~Registered!", 3000, 1);
		}
		else SendClientMessage(playerid, ERROR, "This account is already registered in our system. Use: /login [PASSWORD]");
		return true;
	}
Screenshot:


Includes in my gamemodes:

#include <a_samp>
#include <sscanf2>
#include <streamer>
#include <regex>
#include <dudb>
#include <CPLoader>
#include <ladmin>
#include <zcmd>

Can someone help me with this?

EDIT: No one is able to fix this problem
Reply
#2

Bump. Can someone help me please? need to fix these errors as soon as possible and I promise to give rep.
Reply
#3

Try changing
pawn Код:
CMD:register(playerid, params[])
To:
pawn Код:
CMD:register(playerid,params[])
Reply
#4

you don't need callback(zcmd_no_callback)
you need put simply command
Reply
#5

Quote:
Originally Posted by clarencecuzz
Посмотреть сообщение
Try changing
pawn Код:
CMD:register(playerid, params[])
To:
pawn Код:
CMD:register(playerid,params[])
Still
Reply
#6

Wait... where have you placed this command? Under OnPlayerCommandText or any other public function?

EDIT: With ZCMD, you do not have to place commands under OnPlayerCommandText. If you are converting from strcmp to ZCMD, follow the instructions below.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/mystrcmp", true) == 0)
    {
    //Do Something Here
    }
 
    if(strcmp(cmdtext, "/myzcmd", true) == 0)
    {
    //Do Something here
    }
    return 1;
}
Should Be Changed To:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/mystrcmp", true) == 0)
    {
    //Do Something here
    }
    return 1;
}

CMD:myzcmd(playerid, params[])
{
    //Do Something Here
    return 1;
}
As you can see, the strcmp remains under OnPlayerCommandText, while the ZCMD can move anywhere it wants, baring in mind that all includes functions are already defined before being used.
Reply
#7

Try to put the Zcmd commands in the end/last of the script
Not in Cellbacks
Reply
#8

Place the command at the bottom of your script not under OnPlayerCommandText.
Reply
#9

Quote:
Originally Posted by clarencecuzz
Посмотреть сообщение
Wait... where have you placed this command? Under OnPlayerCommandText or any other public function?

EDIT: With ZCMD, you do not have to place commands under OnPlayerCommandText. If you are converting from strcmp to ZCMD, follow the instructions below.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/mystrcmp", true) == 0)
    {
    //Do Something Here
    }
 
    if(strcmp(cmdtext, "/myzcmd", true) == 0)
    {
    //Do Something here
    }
    return 1;
}
Should Be Changed To:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/mystrcmp", true) == 0)
    {
    //Do Something here
    }
    return 1;
}

CMD:myzcmd(playerid, params[])
{
    //Do Something Here
    return 1;
}
As you can see, the strcmp remains under OnPlayerCommandText, while the ZCMD can move anywhere it wants, baring in mind that all includes functions are already defined before being used.
zcmd+strcmp will not work,will be Unknown Command
like i say this
http://forum.sa-mp.com/showpost.php?...67&postcount=4
Reply
#10

I know... I'm showing the difference between strcmp and ZCMD...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)