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



zcmd errors - Garc1a - 04.07.2012

Quote:

Team Deathmatch\gamemodes\TRU.pwn(604) : error 029: invalid expression, assumed zero
Team Deathmatch\gamemodes\TRU.pwn(604) : error 017: undefined symbol "cmd_teamchat"
Team Deathmatch\gamemodes\TRU.pwn(604) : error 029: invalid expression, assumed zero
Team Deathmatch\gamemodes\TRU.pwn(604) : fatal error 107: too many error messages on one line

I have #include <zcmd> on the top.

Any solutions?


Respuesta: zcmd errors - Chris1337 - 04.07.2012

show the last code before the error and the one >604


Re: zcmd errors - Garc1a - 04.07.2012

Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    new cmd[256];
    new idx;
    cmd = strtok(cmdtext, idx);
    CMD:teamchat(playerid, params[])
    {
        if(IsPlayerConnected(playerid))
        {
            new sendername[MAX_PLAYER_NAME];
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new length = strlen(cmdtext);

            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[64];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_GREY, "USAGE: (/t)eam©hat [message]");
                return 1;
            }
            new team = gTeam[playerid];
            new string[128];
            format(string, sizeof(string), "[Team Chat] %s: %s", sendername, result);
            SendTeamMessage(team, 0x7BDDA5AA, string);
            printf("%s", string);
        }
        return 1;
	}



Respuesta: zcmd errors - Chris1337 - 04.07.2012

The Commands MUST BE AT END OF SCRIPT , not at any public function

and i think that command is wrong with zcmd , that must be With a_samp functions


Re: Respuesta: zcmd errors - Garc1a - 04.07.2012

Quote:
Originally Posted by axxelac
Посмотреть сообщение
The Commands MUST BE AT END OF SCRIPT , not at any public function

and i think that command is wrong with zcmd , that must be With a_samp functions
At the very top of my script I have:
#include <a_samp>
#include <zcmd>

I've moved it out of the public function and to the bottom of my script and the errors still occur.


Re: zcmd errors - Garc1a - 04.07.2012

The bottom of my script:
Код:
}
CMD:rules(playerid, params[])
{
	if(IsPlayerConnected(playerid))
 	{
  	ShowPlayerDialog(playerid, DIALOG_RULES, DIALOG_STYLE_LIST, "Rules", "1. No Teamkilling (Accidental is fine)\n2. No Car Parking\n3. No Hacking or Bug Abusing\n4. No Insulting Others\n5. No Spamming\n6. Always follow orders from Administators!\n7. Speak English at all times\n8. No Spawn Killing\n9. No Boosting (Letting a Player kill you over and over or vice versa)\n10. No Driver Drive-By (DDB)", "Okay", "");
	return 1;
}
CMD:kill(playerid, params[])
{
	if(IsPlayerConnected(playerid))
 	{
  	SetPlayerHealth(playerid, 0);
	return 1;
}

CMD:clanspawn_test(playerid, params[])
{
	Locked[playerid] = 0;
 	SendClientMessage(playerid, COLOR_YELLOW, "Clan spawn successful");
	return 1;
}
CMD:levels(playerid, params[])
{
	if(IsPlayerConnected(playerid))
 	{
	SendClientMessage(playerid,COLOR_GREY,"0-49 kills: Desert Eagle.");
	SendClientMessage(playerid,COLOR_GREY,"50-99 kills: Desert Eagle, Shotgun.");
	SendClientMessage(playerid,COLOR_GREY,"100-149 kills: Desert Eagle, Shotgun, MP5.");
	SendClientMessage(playerid,COLOR_GREY,"150-199 kills: Desert Eagle, Shotgun, MP5, AK47.");
	SendClientMessage(playerid,COLOR_GREY,"200-249 kills: Desert Eagle, Shotgun, MP5, AK47, County Rifle.");
	SendClientMessage(playerid,COLOR_GREY,"250-299 kills: Desert Eagle, Shotgun, MP5, County Rifle, M4A1.");
	SendClientMessage(playerid,COLOR_GREY,"300-349 kills: Desert Eagle, MP5, County Rifle, M4A1, SPAS12.");
	SendClientMessage(playerid,COLOR_GREY,"350-399 kills: Desert Eagle, MP5, M4A1, SPAS12, Sniper Rifle.");
	SendClientMessage(playerid,COLOR_GREY,"400-449 kills: Desert Eagle, MP5, M4A1, SPAS12, Sniper Rifle, 25 armor.");
	SendClientMessage(playerid,COLOR_GREY,"TO VIEW MORE, DO /levels2");
	return 1;
}
CMD:levels2(playerid, params[])
{
	if(IsPlayerConnected(playerid))
 	{
	SendClientMessage(playerid,COLOR_GREY,"450-499 kills: Desert Eagle, MP5, M4A1, SPAS12, Sniper Rifle, 50 armor.");
	SendClientMessage(playerid,COLOR_GREY,"500-549 kills: Desert Eagle, Shotgun, MP5, M4A1, SPAS12, Sniper Rifle, 75 armor.");
	SendClientMessage(playerid,COLOR_GREY,"550-599 kills: Desert Eagle, Shotgun, MP5, M4A1, SPAS12, Sniper Rifle, 100 armor.");
	SendClientMessage(playerid,COLOR_GREY,"600-649 kills: Desert Eagle, Shotgun, MP5, M4A1, SPAS12, Sniper Rifle, 100 armor, Grenades.");
	SendClientMessage(playerid,COLOR_GREY,"650-9999 kills: Desert Eagle, Shotgun, MP5, M4A1, SPAS12, Sniper Rifle, 100 armor, Grenades, RPG.");
	return 1;
}

	}
	return 0;
}
Errors:
Quote:

Team Deathmatch\gamemodes\TRU.pwn(796) : error 029: invalid expression, assumed zero
Team Deathmatch\gamemodes\TRU.pwn(796) : error 017: undefined symbol "cmd_kill"
Team Deathmatch\gamemodes\TRU.pwn(796) : error 029: invalid expression, assumed zero
Team Deathmatch\gamemodes\TRU.pwn(796) : fatal error 107: too many error messages on one line




Re: zcmd errors - Garc1a - 04.07.2012

bump, any solutions?


Re: zcmd errors - StrangeLove - 04.07.2012

Try:

pawn Код:
CMD:rules(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
    ShowPlayerDialog(playerid, DIALOG_RULES, DIALOG_STYLE_LIST, "Rules", "1. No Teamkilling (Accidental is fine)\n2. No Car Parking\n3. No Hacking or Bug Abusing\n4. No Insulting Others\n5. No Spamming\n6. Always follow orders from Administators!\n7. Speak English at all times\n8. No Spawn Killing\n9. No Boosting (Letting a Player kill you over and over or vice versa)\n10. No Driver Drive-By (DDB)", "Okay", "");
}
    return 1;
}
CMD:kill(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
    SetPlayerHealth(playerid, 0);
}
    return 1;
}

CMD:clanspawn_test(playerid, params[])
{
    Locked[playerid] = 0;
    SendClientMessage(playerid, COLOR_YELLOW, "Clan spawn successful");
    return 1;
}
CMD:levels(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
    SendClientMessage(playerid,COLOR_GREY,"0-49 kills: Desert Eagle.");
    SendClientMessage(playerid,COLOR_GREY,"50-99 kills: Desert Eagle, Shotgun.");
    SendClientMessage(playerid,COLOR_GREY,"100-149 kills: Desert Eagle, Shotgun, MP5.");
    SendClientMessage(playerid,COLOR_GREY,"150-199 kills: Desert Eagle, Shotgun, MP5, AK47.");
    SendClientMessage(playerid,COLOR_GREY,"200-249 kills: Desert Eagle, Shotgun, MP5, AK47, County Rifle.");
    SendClientMessage(playerid,COLOR_GREY,"250-299 kills: Desert Eagle, Shotgun, MP5, County Rifle, M4A1.");
    SendClientMessage(playerid,COLOR_GREY,"300-349 kills: Desert Eagle, MP5, County Rifle, M4A1, SPAS12.");
    SendClientMessage(playerid,COLOR_GREY,"350-399 kills: Desert Eagle, MP5, M4A1, SPAS12, Sniper Rifle.");
    SendClientMessage(playerid,COLOR_GREY,"400-449 kills: Desert Eagle, MP5, M4A1, SPAS12, Sniper Rifle, 25 armor.");
    SendClientMessage(playerid,COLOR_GREY,"TO VIEW MORE, DO /levels2");
}
    return 1;
}
CMD:levels2(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
    SendClientMessage(playerid,COLOR_GREY,"450-499 kills: Desert Eagle, MP5, M4A1, SPAS12, Sniper Rifle, 50 armor.");
    SendClientMessage(playerid,COLOR_GREY,"500-549 kills: Desert Eagle, Shotgun, MP5, M4A1, SPAS12, Sniper Rifle, 75 armor.");
    SendClientMessage(playerid,COLOR_GREY,"550-599 kills: Desert Eagle, Shotgun, MP5, M4A1, SPAS12, Sniper Rifle, 100 armor.");
    SendClientMessage(playerid,COLOR_GREY,"600-649 kills: Desert Eagle, Shotgun, MP5, M4A1, SPAS12, Sniper Rifle, 100 armor, Grenades.");
    SendClientMessage(playerid,COLOR_GREY,"650-9999 kills: Desert Eagle, Shotgun, MP5, M4A1, SPAS12, Sniper Rifle, 100 armor, Grenades, RPG.");
}
    return 1;
}