Help me please.
#1

pawn Код:
if(g_fMask[playerid])
    {
        new string[128];
        format(string, sizeof string, "Stranger: %s", text);
        NearByMessage(WHITE, string);
        return 0;
    }
I then get this error

pawn Код:
C:\Users\Callum\Desktop\1996RP\Windows\gamemodes\1996RP.pwn(10919) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Callum\Desktop\1996RP\Windows\gamemodes\1996RP.pwn(10921) : error 035: argument type mismatch (argument 2)
Reply
#2

do you have "string[128]" already anywhere else?
and btw the stringsize does not has to be that large
it will be like a hanger for a rcp lane
Reply
#3

Thanks for the response but i've tried changing the sting number several times but it still ain't working.

Edit: also if it helps it used to be SendClientMessageToAll which worked fine before.
Reply
#4

that string number is just a minor part
but do you has "string[128]" already in your script?
i think that is the problem
Reply
#5

Yeah i do and have used it several times without an error.
Reply
#6

pawn Код:
if(g_fMask[playerid])
{
    format(string, sizeof string, "Stranger: %s", text);
    NearByMessage(playerid, WHITE, string);
    return 0;
}
Reply
#7

pawn Код:
command(mask, playerid, params[])
{
    if((g_fMask[playerid] = !g_fMask[playerid]))
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
            ShowPlayerNameTagForPlayer(i, playerid, 0);
        SendClientMessage(playerid, PURPLE, "You have put on a mask." );
    } else {
        for(new i = 0; i < MAX_PLAYERS; i++)
            ShowPlayerNameTagForPlayer(i, playerid, 1);
        SendClientMessage(playerid, PURPLE, "You have taken the mask off." );
    }
    return 1;
}
Other bit of the script if it helps
Reply
#8

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
pawn Код:
if(g_fMask[playerid])
{
    format(string, sizeof string, "Stranger: %s", text);
    NearByMessage(playerid, WHITE, string);
    return 0;
}
Thanks a bunch
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)