14.06.2010, 18:49
pawn Code:
if(strcmp(mCommand, "hide", true) == 0)
{
if(PlayerInfo[playerid][Level] >= 3)
{
new sCommand[4];
if(sscanf(params, "s[20]s[4]",mCommand, sCommand))
{
SendClientMessage(playerid, Red, "USAGE: /my hide [on/off]");
}
else if(strcmp(sCommand, "on", true) == 0)
{
if(PlayerInfo[playerid][Hidden] == 1) return SendClientMessage(playerid, Red, "You are already invisible!");
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && PlayerInfo[i][Level] < 3)
{
ShowPlayerNameTagForPlayer(i, playerid, false);
SetPlayerMarkerForPlayer(i, playerid, (GetPlayerColor(playerid) & 0xFFFFFF00));
}
}
format(string, sizeof(string), "%s[%d] is now hidden for players", pName(playerid), playerid);
MessageToAdminsEx(playerid, MAD_WHITE, string);
PlayerInfo[playerid][Hidden] = 1;
SendClientMessage(playerid, MANAGEMENT, "* You are now invisible to players.");
return 1;
}
else if(strcmp(sCommand, "off", true) == 0)
{
if(PlayerInfo[playerid][Hidden] == 0) return SendClientMessage(playerid, Red, "You're hide is already off!");
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && PlayerInfo[i][Level] < 3)
{
ShowPlayerNameTagForPlayer(i, playerid, false);
SetPlayerMarkerForPlayer(i, playerid, (GetPlayerColor(playerid)));
}
}
format(string, sizeof(string), "%s[%d] is not invisible anymore.", pName(playerid), playerid);
MessageToAdminsEx(playerid, MAD_WHITE, string);
PlayerInfo[playerid][Hidden] = 0;
SendClientMessage(playerid, MANAGEMENT, "* You are now invisible to players.");
return 1;
}
} else return 0;
}
}