Warning 219 and Warning 204
#1

Here's the warning code..

PHP код:
C:\Users\Windows7\Desktop\Microsoft Corporation (c)\replace\Irish Verse\gamemodes\IVRP.pwn(26040) : warning 219local variable "string" shadows a variable at a preceding level
C
:\Users\Windows7\Desktop\Microsoft Corporation (c)\replace\Irish Verse\gamemodes\IVRP.pwn(26033) : warning 204symbol is assigned a value that is never used"string"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
2 Warnings

Here's the code..

Код:
CMD:release(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 3)
    {
        if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
         {
              SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");
            return 1;
         }
        new string[128], giveplayerid;
        if(PlayerInfo[giveplayerid][pRelease] == 1)
        {
        SendClientMessage(playerid, COLOR_GRAD1, "You can't release a player with /norelease cmd!");
        }
        else
        {
        new string[128], reason[64];
        if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /release [playerid/partofname] [reason]");

        if(IsPlayerConnected(giveplayerid))
        	{
            format(string, sizeof(string), "AdmCmd: %s has been released from prison by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
            Log("logs/admin.log", string);
            format(string, sizeof(string), "AdmCmd: %s has been released from prison by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
            SendClientMessageToAllEx(COLOR_LIGHTRED, string);
            PlayerInfo[giveplayerid][pJailed] = 0;
            PlayerInfo[giveplayerid][pWantedLevel] = 0;
            SetPlayerToTeamColor(giveplayerid);
            SetPlayerWantedLevel(giveplayerid, 0);
            PlayerInfo[giveplayerid][pJailTime] = 0;
            SetPlayerPos(giveplayerid, 1529.6,-1691.2,13.3);
            SetPlayerInterior(giveplayerid,0);
            PlayerInfo[giveplayerid][pInt] = 0;
            SetPlayerVirtualWorld(giveplayerid, 0);
            PlayerInfo[giveplayerid][pVW] = 0;
            PhoneOnline[giveplayerid] = 0;
            }
       	 }
	}
    return 1;
}
Reply
#2

If a string has been created and is within reach of the code below then you do not need to re-create it.
Reply
#3

Okay thanks. +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)