SA-MP Forums Archive
Help! pls - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help! pls (/showthread.php?tid=211630)



Help! pls - MiskOo - 15.01.2011

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;
}


Re: Help! pls - Jochemd - 15.01.2011

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


Re: Help! pls - MiskOo - 16.01.2011

tnx, you are the best )