09.01.2013, 22:31
AFter adding the CMD i have one problem When people have mask they lose it of they relogged And
When people talk in /b or /s or /l or anything their name still, it's not changed to Stranger..
Can you edit it?
[/quote]
When people talk in /b or /s or /l or anything their name still, it's not changed to Stranger..
Can you edit it?
pawn Код:
new GiveMask[MAX_PLAYERS]; // Top of script
new MaskOn[MAX_PLAYERS]; // Top of script
//Commands can be anywhere except not in call backs like OnPlayerCommandText, or OnPlayerSpawn.
CMD:givemask(playerid, params[])
{
new targetid;
if(IsPlayerAdmin(playerid))
{
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "USAGE: /givemask [playerid]");
else if(targetid == INVALID_PLAYER_ID) SendClientMessage(playerid, -1, "Player not online !");
else
{
if(GiveMask[targetid] == 1)
{
SendClientMessage(playerid, -1, "Player already has a mask!");
}
else
{
GiveMask[targetid] = 1;
}
}
}
else return SendClientMessage(playerid, -1, "You're not authorized to use this command !");
return 1;
}
CMD:mask(playerid, params[])
{
if(GiveMask[playerid] == 1)
{
if(MaskOn[playerid] == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
ShowPlayerNameTagForPlayer(i, playerid, 0);
}
}
MaskOn[playerid] = 1;
SendClientMessage(playerid, 1, "* You've put your mask on!");
}
else if(MaskOn[playerid] == 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
ShowPlayerNameTagForPlayer(i, playerid, 1);
}
}
SendClientMessage(playerid, 1, "* You've put your mask off!");
MaskOn[playerid] = 0;
}
}
return 1;
}