warning
#1

C:\Users\Mohamad\Desktop\SRP.pwn(48745) : warning 219: local variable "string" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.


pawn Код:
if(Phunted[playerid] != 0 && hunted == playerid)
    {
        new string[128];
        format(string, sizeof(string), "Please forgive %s for killing the hunted %s.", GetPlayerNameEx(killerid),killerid,GetPlayerNameEx(playerid),playerid);
        SendClientMessageToAllEx(COLOR_LIGHTBLUE, string);
        GivePrize(killerid, huntedpricetype);
        Phunted[playerid] = 0;
        hunted = INVALID_PLAYER_ID;
    }
Reply
#2

It means you already have a string, identified. Check your call backs
Reply
#3

ok thanks bro
Reply
#4

Delete this line

new string[128];

And it will work just fine
Reply
#5

No Dont delete it
just rename it to smth else
like

new string2[128];

that works fine
Reply
#6

It's declared as global but it's better to use local variables for strings (basically arrays) because you can use lower size and it's not going to be a waste.

Replace:
pawn Код:
new string[128];
format(string, sizeof(string), "Please forgive %s for killing the hunted %s.", GetPlayerNameEx(killerid),killerid,GetPlayerNameEx(playerid),playerid);
SendClientMessageToAllEx(COLOR_LIGHTBLUE, string);
with:
pawn Код:
new sz_Msg[83];
format(sz_Msg, sizeof(sz_Msg), "Please forgive %s for killing the hunted %s.", GetPlayerNameEx(killerid),GetPlayerNameEx(playerid));
SendClientMessageToAllEx(COLOR_LIGHTBLUE, sz_Msg);
You had also 2 arguments more but without a placeholder in the format.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)