Masks. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Masks. (
/showthread.php?tid=252060)
Masks. -
iGetty - 30.04.2011
How could I make so when a player does /mask it sets there name to Stranger 1/2/3/4/etc..
and also, when they /unmask there names go back to normal? Thanks in advance.
AW: Masks. -
Nero_3D - 30.04.2011
/mask
Save the name in a pvar of array
Change the player name to StrangerUNIQUEID also StrangerPLAYERID
/unmask
Give the old name back which is stored
The only problem I see is that someone could rejoin the server with your real name!
But that can be prevented if you add a check in OnPlayerUpdate if the name is saved
Re: Masks. -
Hornet600 - 30.04.2011
pawn Код:
command(mask, playerid, params[])
{
new str[24],string[124];
GetPlayerName( playerid , str , 24 );
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(playermask[playerid] = 0)
{
ShowPlayerNameTagForPlayer(i, playerid, 0);
format(string, sizeof(string),"%s you have put a mask");
}
else if(playermask[playerid] = 1)
{
ShowPlayerNameTagForPlayer(i, playerid, 1);
format(string, sizeof(string),"%s you have take off your mask");
}
}
}
SendClientMessage(playerid,0x9EC73DAA,string);
return 1;
}
Now you should improve that code
EDIT: top gm new playermask[MAX_PLAYERS];
You can create mask ids trought the playerid for exemple some the player id with a random number and store the number in a player variable them you subtract the var for future admin cmds or other features
Re: Masks. -
iGetty - 30.04.2011
Quote:
Originally Posted by Hornet600
pawn Код:
command(mask, playerid, params[]) { new str[24],string[124]; GetPlayerName( playerid , str , 24 ); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(playermask[playerid] = 0) { ShowPlayerNameTagForPlayer(i, playerid, 0); format(string, sizeof(string),"%s you have put a mask"); } else if(playermask[playerid] = 1) { ShowPlayerNameTagForPlayer(i, playerid, 1); format(string, sizeof(string),"%s you have take off your mask"); } } } SendClientMessage(playerid,0x9EC73DAA,string); return 1; }
Now you should improve that code
EDIT: top gm new playermask[MAX_PLAYERS];
You can create mask ids trought the playerid for exemple some the player id with a random number and store the number in a player variable them you subtract the var for future admin cmds or other features
|
pawn Код:
C:\Documents and Settings\d\Desktop\lvrp\Windows\gamemodes\VortexRoleplay.pwn(10917) : warning 211: possibly unintended assignment
C:\Documents and Settings\d\Desktop\lvrp\Windows\gamemodes\VortexRoleplay.pwn(10922) : warning 211: possibly unintended assignment
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
Re: Masks. - Max_Coldheart - 30.04.2011
pawn Код:
new playermask[MAX_PLAYERS];
Re: Masks. -
iGetty - 30.04.2011
I put that, already.. It was because of the =, it was supposed to be two =='s Thanks anyway.