I really need help
#1

Code:
pawn Код:
dcmd_setvip(playerid,params[])
{
    if(PlayerInfo[playerid][pLoggedIn] == 1)
    {
        if(PlayerInfo[playerid][pAdmin] >= 5 || IsPlayerAdmin(playerid))
        {
            new tmp [256];
            new tmp2[256];
            new Index;
            tmp  = strtok(params,Index);
            tmp2 = strtok(params,Index);
            if(!strlen(params)) return
            SendClientMessage(playerid, COLOR_RED, "Usage: /setvip (Player ID) (AccountType [0-5])");

            new player1, type, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
            player1 = strval(tmp);
            if(!strlen(tmp2)) return
            SendClientMessage(playerid, COLOR_RED, "Usage: /setvip (Player ID) (AccountType [0-5])");
            type = strval(tmp2);

            if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
            {
                if(PlayerInfo[player1][pLoggedIn] == 1)
                {
                if(type > 5)
                return SendClientMessage(playerid,COLOR_RED,"ERROR: Invalid VIP Type!");
                if(type == PlayerInfo[player1][pVip])
                return SendClientMessage(playerid,COLOR_RED,"ERROR: Player is already this VIP level.");
                GetPlayerName(player1, playername, sizeof(playername));
                GetPlayerName(playerid, adminname, sizeof(adminname));

                if(type > 0)
                format(string,sizeof(string),"-| Administrator %s has set your VIP Type to: %d |-",adminname,type);
                else
                format(string,sizeof(string),"|- Administrator %s has set your VIP Type to TYPE 0. |-",adminname);
                SendClientMessage(player1, COLOR_AQUA, string);

                format(string,sizeof(string),"-| You have given %s Account Type: %s |-", playername, type);
                SendClientMessage(playerid,COLOR_AQUA,string);
                INI_Open(UserPath(playerid));
                INI_Int("VipType",type);
                INI_Close(UserPath(playerid));
                PlayerInfo[player1][pVip] = type;
                }
                return SendClientMessage(playerid,COLOR_RED,"ERROR: This player is not logged in");
            }
            else return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected");
        }
        else return SendClientMessage(playerid, COLOR_RED, "ERROR: You must be level 6 or RCON admin to use this command");
    }
    else return SendClientMessage(playerid,COLOR_RED,"ERROR: You must be logged in to use this command.");
}
Errors:
Код:
C:\Users\Keegan\Desktop\filterscripts\WWAdmin.pwn(377) : warning 219: local variable "pname" shadows a variable at a preceding level
C:\Users\Keegan\Desktop\filterscripts\WWAdmin.pwn(416) : warning 217: loose indentation
C:\Users\Keegan\Desktop\filterscripts\WWAdmin.pwn(511) : error 017: undefined symbol "name"
C:\Users\Keegan\Desktop\filterscripts\WWAdmin.pwn(511) : error 017: undefined symbol "value"
C:\Users\Keegan\Desktop\filterscripts\WWAdmin.pwn(512) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Reply
#2

Highlight the following lines in bold:

511
512
Reply
#3

This is for the warning: warning 219: local variable "pname" shadows a variable at a preceding level

https://sampforum.blast.hk/showthread.php?tid=331700
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)