Warn command errors...
#1

Command:
pawn Код:
CMD:warn(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid) || PlayerInfo[playerid][pVip] >= 3)
    {
        {
        new targetid, reason;
        new Name[MAX_PLAYER_NAME];
        new Name1[MAX_PLAYER_NAME];
        GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
        GetPlayerName(targetid, Name1, MAX_PLAYER_NAME);
        if(sscanf(params, "ri", targetid, reason)) return SendClientMessage(playerid, COLOR_PURPLE,"Usage: /warn [playerid] [reason]");
        if(targetid == playerid) return SendClientMessage(playerid, COLOR_DRED, "You Can't Warn Yourself!");
        }
        else
        {
            new str[128];
            format(str, sizeof(str), "Administrator %s Has Warned %s Reason: %d!", Name, Name1, reason);
            SendClientMessageToAll(COLOR_DRED,str);
            Warns[targetid] ++;
        }
    }
}
Errors:
pawn Код:
C:\Users\asus\Desktop\Server 0.3e\gamemodes\Stunt.pwn(2900) : error 029: invalid expression, assumed zero
C:\Users\asus\Desktop\Server 0.3e\gamemodes\Stunt.pwn(2903) : error 017: undefined symbol "Name"
C:\Users\asus\Desktop\Server 0.3e\gamemodes\Stunt.pwn(2905) : error 017: undefined symbol "targetid"
C:\Users\asus\Desktop\Server 0.3e\gamemodes\Stunt.pwn(2908) : warning 209: function "cmd_warn" should return a value
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.
Line 2903:
pawn Код:
format(str, sizeof(str), "Administrator %s Has Warned %s Reason: %d!", Name, Name1, reason);
Reply
#2

pawn Код:
CMD:warn(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid) || PlayerInfo[playerid][pVip] >= 3)
    {
        //new reason[32];
        if(sscanf(params, "rs[32]", targetid, reason))
            return SendClientMessage(playerid, COLOR_PURPLE,"Usage: /warn [playerid] [reason]");
        if(targetid == playerid) return SendClientMessage(playerid, COLOR_DRED, "You Can't Warn Yourself!");


        new str[128],targetid, reason,Name[MAX_PLAYER_NAME],Name1[MAX_PLAYER_NAME];
        GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
        GetPlayerName(targetid, Name1, MAX_PLAYER_NAME);
        format(str, sizeof(str), "Administrator %s Has Warned %s Reason: %d!", Name, Name1, reason);
        SendClientMessageToAll(COLOR_DRED,str);
        Warns[targetid] ++;
    }
    return true;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)