/mask Problem.
#1

pawn Код:
command(mask, playerid, params[])
{
    new number = (100 + random(899)), string[128];
    masknumber[playerid] = number;
    if(Player[playerid][Masked] == 0)
    {
        if(Player[playerid][Level] >= 6)
        {
            for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(i, playerid, false);
            format(string, sizeof(string), "Stranger_%d", masknumber[playerid]);
            Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 3.0);
            ApplyAnimation(playerid, "goggles", "goggles_put_on", 4.1, 0, 1, 1, 0, 1, 1);
            Player[playerid][Masked] = 1;
            format(string, sizeof(string), "* Stranger_%d puts on their mask *", masknumber[playerid]);
            NearByMessage(playerid, PINK, string);
        }
        else return SendClientMessage(playerid, GREY, "You must be level 6+ to use a Mask.");
    }
    else return SendClientMessage(playerid, GREY, "You are already masked.");
    return 1;
}
The Attach3DTextLabelToPlayer Won't show up on the server, It's because my include are outdated or?
Reply
#2

pawn Код:
command(mask, playerid, params[])
{
    new number = (100 + random(899)), string[128];
    masknumber[playerid] = number;
    if(Player[playerid][Masked] == 0)
    {
        if(Player[playerid][Level] >= 6)
        {
            for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(i, playerid, false);
            format(label[playerid], sizeof(label[playerid]), "Stranger_%d", masknumber[playerid]);
            Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 3.0);
            ApplyAnimation(playerid, "goggles", "goggles_put_on", 4.1, 0, 1, 1, 0, 1, 1);
            Player[playerid][Masked] = 1;
            format(string, sizeof(string), "* Stranger_%d puts on their mask *", masknumber[playerid]);
            NearByMessage(playerid, PINK, string);
        }
        else return SendClientMessage(playerid, GREY, "You must be level 6+ to use a Mask.");
    }
    else return SendClientMessage(playerid, GREY, "You are already masked.");
    return 1;
}
Try this, why were you formatting "string" when you did nothing with that formatted string and then just formatted it again. It looked like the label[playerid] wasn't formatted from what I saw.

TIP: use [.pawn]pawnscripthere[/.pawn] to show it in the pawn code (remove the periods). This is easier for us scripters and helpers.
Reply
#3

Just Try'ed and i got this error.

Код:
C:\Users\xx\Desktop\xxx\gamemodes\xx-rp.pwn(16752) : error 080: unknown symbol, or not a constant symbol (symbol "playerid")
Line 16752:
pawn Код:
format(label[playerid], sizeof(label[playerid]), "Stranger_%d", masknumber[playerid]);
Reply
#4

bro do [ c o d e] [/ c o d e] WITHOUT SPACES and give us the errors and the filterscript...
Reply
#5

Not quite sure if this would be your problem, but is "label[MAX_PLAYERS]" actually a string?

I think you have to make a double dimensional array so that you can store a string length in it as-well (I could be wrong).

(Since playerid is fine everywhere else, it couldn't be because playerid isn't defined (plus it's a command))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)