/mask Problem. -
Henry_Martinez - 27.06.2012
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?
Re: /mask Problem. -
Kindred - 27.06.2012
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.
Re: /mask Problem. -
Henry_Martinez - 27.06.2012
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]);
Re: /mask Problem. -
[A]ndrei - 27.06.2012
bro do [ c o d e] [/ c o d e] WITHOUT SPACES and give us the errors and the filterscript...
Re: /mask Problem. -
Kindred - 27.06.2012
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))