String ERROR
#1

Код:
	 //===============================================================================================================//
if(strcmp(cmd, "/announce", true) == 0)
{
new length = strlen(cmdtext);
if(adminlevel[playerid] < 1 ) return 0;
else
        if(logged[playerid] == 0) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You cannot use commands because you are not logged in.");
        else

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_WHITE, "USAGE: /announce [text]");
return 1;
}
GameTextForAll(result, 5000, 0);
new pName[MAX_PLAYER_NAME];
                GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
	            format(string, sizeof(string), "Admin %s has used /announce command", pName);
	            SendClientMessageToAdmins(COLOR_WHITE, string);
return 1;
}

//===============================================================================================================//


                if(strcmp(cmd, "/chatannounce", true) == 0)
                {
        if(adminlevel[playerid] < 1 ) return 0;
else
        if(logged[playerid] == 0) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You cannot use commands because you are not logged in.");
        else
{
                                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_WHITE, "USAGE: /chatannounce [text]");
                                        return 1;
                                }

                                format(tString,sizeof(tString), " %s", result);
                                SendClientMessageToAll(COLOR_GREEN, "----------------------------------------------------");
                                SendClientMessageToAll(COLOR_YELLOW,tString);
                                SendClientMessageToAll(COLOR_GREEN, "----------------------------------------------------");
	 new pName[MAX_PLAYER_NAME];
                GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
	            format(string, sizeof(string), "Admin %s has used /chatannounce command", pName);
	            SendClientMessageToAdmins(COLOR_WHITE, string);
                                return 1;
                        }
                }
all when i got that its say 4ERROR:

C:\Documents and Settings\Administrateur\Bureau\httppastebin.combp6 ZSP7A\gamemodes\ZZZZ.pwn(220) : warning 201: redefinition of constant/macro (symbol "SLOTS")
C:\Documents and Settings\Administrateur\Bureau\httppastebin.combp6 ZSP7A\gamemodes\ZZZZ.pwn(1383) : error 017: undefined symbol "string"
C:\Documents and Settings\Administrateur\Bureau\httppastebin.combp6 ZSP7A\gamemodes\ZZZZ.pwn(1383) : error 017: undefined symbol "string"
C:\Documents and Settings\Administrateur\Bureau\httppastebin.combp6 ZSP7A\gamemodes\ZZZZ.pwn(1383) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrateur\Bureau\httppastebin.combp6 ZSP7A\gamemodes\ZZZZ.pwn(1383) : fatal error 107: too many error messages on one line

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


4 Errors.
Reply
#2

pawn Код:
new string[128];
Put that in your command, or in the command callback.
Reply
#3

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new string[128];
Add string on top of OnPlayerCommandText.
Reply
#4

another ERROR: error 017: undefined symbol "tString"
Reply
#5

Lol

pawn Код:
new tString[128];
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)