Script small question -
Scriptissue - 27.09.2010
I made this little script just so that people could not see certain player's Tagname, however It seems like when I use the command It masks everyone's Tagname but not mine, on my screen I can't see Tagnames, and other players are indeed able to see my tagname, How can I turn it so that people won't be able to see a certain player's Tagname when he uses the command ?
PHP код:
if (strcmp("/mask", cmdtext, true) == 0)
{
for(new i = 0; i < playerid; i++) ShowPlayerNameTagForPlayer(playerid, i, false);
GameTextForPlayer(playerid, "~W~You have put mask ~g~ on", 5000, 5);
return 1;
}
Re: Script small question -
sekol - 27.09.2010
Use it like this maybe?
Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
ShowPlayerNameTagForPlayer(i, playerid, 0);
}
and for showing it again
Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
ShowPlayerNameTagForPlayer(i, playerid, 1);
Re: Script small question -
Scriptissue - 27.09.2010
Could you summarize it into a one script, I can't use it, I'm messed up.
Re: Script small question -
sekol - 27.09.2010
PHP код:
if (strcmp("/mask", cmdtext, true) == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
ShowPlayerNameTagForPlayer(i, playerid, 0);
GameTextForPlayer(playerid, "~W~You have put mask ~g~ on", 5000, 5);
}
}
return 1;
}
if (strcmp("/maskoff", cmdtext, true) == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
ShowPlayerNameTagForPlayer(i, playerid, 1);
GameTextForPlayer(playerid, "~W~You have put mask ~g~ off", 5000, 5);
}
}
return 1;
}
It should work.
Re: Script small question -
Scriptissue - 27.09.2010
Wow it works, thanks a lot !
Can you help me with one more small thing, I want to add "Mask" into a shop list, so that people could use it only when they have it.
how can I do it ?
I already have a purchase menu, can you help me add it ?
Re: Script small question -
sekol - 28.09.2010
It's also very simple... If you are using pInfo's you can do it like this.
PHP код:
if (strcmp("/buymask", cmdtext, true) == 0)
{
if(IsPlayerConnected(playerid))
{
SetPlayerMoney(playerid, -45);
PlayerInfo[playerid][pHasMask] = 1;
SendClientMessage(playerid, COLOR_RED, "You bought a mask! [/maskoff or /mask]");
}
}
And Mask code should look like this
PHP код:
if (strcmp("/mask", cmdtext, true) == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[playerid][pHasMask] == 1)
{
ShowPlayerNameTagForPlayer(i, playerid, 0);
GameTextForPlayer(playerid, "~W~You have put mask ~g~ on", 5000, 5);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You don't have mask!");
}
}
return 1;
}
Re: Script small question -
Scriptissue - 28.09.2010
I tired to put it on the store Dialog menu but it doesn't work,
How can I put the purchase feature on the shop menu, so that they won't have to use the command, and if they purchase it then they can use it.
Re: Script small question -
Mike_Peterson - 28.09.2010
oh jeez, how could we know how ur dialog looks like.... either post the code here or send me a pm with details
Re: Script small question -
Scriptissue - 28.09.2010
Alright, I was able to make it work, but there is a bug, when people use the mask, and a player logs in the mask won't work, the user who uses the mask will have to use /mask again to cover his Tagname.
How can I add it ?
This is my command :
PHP код:
if(strcmp(cmdtext,"/mask",true) == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
ShowPlayerNameTagForPlayer(i,playerid,0);
if(Mask == 0)return SendClientMessage(playerid,0xFF6C6CFF,"You don't have a mask !");
DisableNameTagLOS();
GameTextForPlayer(playerid, "~W~You have put mask ~g~ on", 5000, 5);
return 1;
}
Re: Script small question -
Mike_Peterson - 28.09.2010
maybe