warn command
#3

your code didn't worked so i modified a /ban command and when i try to compile it get this error

Код:
C:\Documents and Settings\Trulis\Desktop\gta\gamemodes\gtarp.pwn(28897) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Trulis\Desktop\gta\gamemodes\gtarp.pwn(28935) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
This is the code:

pawn Код:
if (strcmp(cmd,"/warn", true) == 0
    {  //this is 28897
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext,idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /warn [playerid/PartOfName]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if (PlayerInfo[playerid][pAdmin] >= 1)
            {
                if(IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                        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_GRAD2, "USAGE: /warn [playerid/PartOfName] [reason]");
                            return 1;
                        }
                        new PlayerName[MAX_PLAYER_NAME];
                        GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
                        format(string, sizeof(string), "AdmCmd: %s has warned %s for %s", giveplayer, sendername,) //this is 28935
                        format(string, sizeof(string), "AdmCmd: %s was warned by %s, reason: %s", giveplayer, sendername, (result))
                        SendClientMessageToAll(COLOR_LIGHTRED, string);
                        PlayerInfo[playerid][pWarns] = PlayerInfo[playerid][pWarns]+1;
                        return 1;
                    }
                }//not connected
            }
            else
            {
                format(string, sizeof(string), "   %d is not online.", giveplayerid);
                SendClientMessage(playerid, COLOR_GRAD1, string);
            }
        }
        return 1;
     }
Reply


Messages In This Thread
warn command - by trulis - 14.02.2012, 12:04
Re : warn command - by ricardo178 - 14.02.2012, 12:13
Re: warn command - by trulis - 14.02.2012, 17:09
Re: warn command - by fordawinzz - 14.02.2012, 18:19
Re: warn command - by trulis - 20.02.2012, 11:26

Forum Jump:


Users browsing this thread: 1 Guest(s)