Help! pls
#1

I have a problem with with function ShowPlayerNameTagForPlayer

I made this, and does not work

if(strcmp(cmd, "/maskaon", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMaska] == 1)
{

SendClientMessage(playerid, 0xD8D8D8FF, " * Now your name is not visible.");
ShowPlayerNameTagForPlayer(playerid, playerid, false);
PlayerInfo[playerid][pMaskana] = 1;
}
else
{
SendClientMessage(playerid, 0xD8D8D8FF, " * Nemate Masku, mozete je kupiti u [DUCAN]");
}
}
return 1;
}
if(strcmp(cmd, "/maskaoff", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMaska] == 1)
{

SendClientMessage(playerid, 0xD8D8D8FF, " * Now your name is visible.");
ShowPlayerNameTagForPlayer(playerid, playerid, true);
PlayerInfo[playerid][pMaskana] = 0;
}
else
{
SendClientMessage(playerid, 0xD8D8D8FF, " * Nemate Masku, mozete je kupiti u [DUCAN]");
}
}
return 1;
}
Reply
#2

It's cause you shouldn't put 'playerid' in the 1st param but a loop

pawn Код:
if(PlayerInfo[playerid][pMaska] == 1)
{
for(new i = 0; i < MAX_PLAYERS; i ++)
{
SendClientMessage(playerid, 0xD8D8D8FF, " * Now your name is not visible.");
ShowPlayerNameTagForPlayer(i, playerid, false);
PlayerInfo[playerid][pMaskana] = 1;
}
}
Sorry for the identation though
Reply
#3

tnx, you are the best )
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)