cmd:mask Not working
#1

Hello Guys,

Here is my command :-
pawn Код:
CMD:mask(playerid, params[])
{
     if(class[playerid][Sniper] == 1)
     {
        SetPlayerAttachedObject(playerid, 1, 19037, 2, 10, 4.7, 0.0, 90, 90, 0);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            ShowPlayerNameTagForPlayer(i, playerid, 0); // ShowPlayerNameTagForPlayer(i, playerid, 0) hide name for all players
            SetPlayerMarkerForPlayer(i,playerid,0);
        }
     }
     if(class[playerid][Sniper] == 0)
     {
        SendClientMessage(playerid, COLOR_RED,"You Need to be in Sniper Class to Use this command");
     }
     return 1;
}
Player can be seen on Map.
I Want that Player cant be seen on map and he/she should get an object attched : hockey mask id : 19037

Thanks.
Reply
#2

-removed-
Reply
#3

Try

Код:
CMD:mask(playerid, params[])
{
	new name[MAX_PLAYER_NAME];
	new string[42];
    if(class[playerid][Sniper] == 1) return SendClientMessage(playerid, COLOR_GREY, "You're not Sniper Man.");

	if(PlayerInfo[playerid][pSniper] == 0)
	{
		for(new i = 0; i < MAX_PLAYERS; i++)
		{
			if(IsPlayerConnected(i))
			{
			ShowPlayerNameTagForPlayer(i, playerid, 0);
			}
		}
		PlayerInfo[playerid][Sniper] = 1;
		GetPlayerName(playerid, name, sizeof(name));
	}
	else if(PlayerInfo[playerid][Sniper] == 1)
	{
		for(new i = 0; i < MAX_PLAYERS; i++)
		{
			if(IsPlayerConnected(i))
			{
				ShowPlayerNameTagForPlayer(i, playerid, 1);
				format(string, 128, "Stranger [ID: %i]", var);
			}
		}
		PlayerInfo[playerid][Sniper] = 0;
		GetPlayerName(playerid, name, sizeof(name));
	}
			else if(GetPVarInt(playerid, "EventToken"))
		{
			SendClientMessageEx(playerid, COLOR_GRAD1, "You can't use this while in an event.");
		}

     else if(class[playerid][Sniper] == 0)
     {
        SendClientMessage(playerid, COLOR_RED,"You Need to be in Sniper Class to Use this command");
     }
	return 1;
}
For fix the attached object : https://sampwiki.blast.hk/wiki/SetPlayerAttachedObject Or I think I did it already
Reply
#4

@^, don't see the SetPlayerAttachedObject, please add this code to have the hockey mask (Red) attached to the face!

Quote:

Use SetPlayerAttachedObject

pawn Код:
SetPlayerAttachedObject(playerid, 1, 19037, 2, 9.4, 3, 0, 90, 90, 0)
^ Is to attach the hockey mask to the face. I don't know about hiding the mask, will find more info soon!

Reply
#5

Quote:
Originally Posted by MyNinja
Посмотреть сообщение
@^, don't see the SetPlayerAttachedObject, please add this code to have the hockey mask (Red) attached to the face!
You forgot in the end that : ";" Then put it please sir.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)