PDA

View Full Version : cmd:mask Not working


Avi57
13/06/2013, 09:23 AM
Hello Guys,

Here is my command :-

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.

MyNinja
13/06/2013, 09:29 AM
-removed-

ProjectFutureRolePlay
13/06/2013, 09:31 AM
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 : http://wiki.sa-mp.com/wiki/SetPlayerAttachedObject Or I think I did it already

MyNinja
13/06/2013, 09:35 AM
@^, don't see the SetPlayerAttachedObject, please add this code to have the hockey mask (Red) attached to the face!

Use SetPlayerAttachedObject


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!

ProjectFutureRolePlay
13/06/2013, 10:16 AM
@^, 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.