zcmd errors
#1

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?
Reply
#2

show the last code before the error and the one >604
Reply
#3

Код:
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;
	}
Reply
#4

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

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

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

Reply
#7

bump, any solutions?
Reply
#8

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


Forum Jump:


Users browsing this thread: 1 Guest(s)