SA-MP Forums Archive
Another problem... - 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: Another problem... (/showthread.php?tid=77945)



Another problem... - FreeSoul - 16.05.2009

Ok,I have this.

Код:
  if (strcmp("/nameoff", cmdtext, true, 5) == 0)
	{
    if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5)
		{
    if (NameOff[playerid] == 0)
    {
    for(new i = 0; i < MAX_PLAYERS; i++)
    ShowPlayerNameTagForPlayer(i,playerid, false);
    NameOff[playerid] = 1;
		 return 1;
		}
		else
		{
     NameOff[playerid] = 0;
     SetPlayerName(playerid, plName[playerid]);
     ShowPlayerNameTagForPlayer(i,playerid, true);
     return 1;
    }
    }
	}
The nametag of the player who typed /nameoff only dissapears for 1 second.
This is really weird O_O



Re: Another problem... - FreeSoul - 16.05.2009

Bump !


Re: Another problem... - Weirdosport - 16.05.2009

You're using your for loop wrongly in the second part of your script (i.e there isn't one there and you're still using i)


Re: Another problem... - Rks25 - 16.05.2009

TIP: Use brackets when looping, than the problem which WeirdoSport just said, won't occur.


Re: Another problem... - FreeSoul - 16.05.2009

Now I have this

Quote:

if (strcmp("/nameoff", cmdtext, true, 5) == 0)
{
if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] ==
{
if (NameOff[playerid] == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
ShowPlayerNameTagForPlayer(i,playerid, false);
SendClientMessage(playerid,COLOR_GREY,"Nobody knows your real identity now!");
NameOff[playerid] = 1;
return 1;
}
else
{
for(new i = 0; i < MAX_PLAYERS; i++)
ShowPlayerNameTagForPlayer(i,playerid, true);
NameOff[playerid] = 0;
SetPlayerName(playerid, plName[playerid]);
SendClientMessage(playerid,COLOR_GREY,"You now have your real identity!");
return 1;
}
}
}

Same thing,the name is still seen.


Re: Another problem... - Ignas1337 - 16.05.2009

pawn Код:
if (strcmp("/nameoff", cmdtext, true, 5) == 0)
  {
   if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == Cool
   {
    if (NameOff[playerid] == 0)
    {
     for(new i = 0; i < MAX_PLAYERS; i++){
     ShowPlayerNameTagForPlayer(i,playerid, false);]
     SendClientMessage(playerid,COLOR_GREY,"Nobody knows your real identity now!");
     NameOff[playerid] = 1;
   
    return 1;
   }
   else
   {
     for(new i = 0; i < MAX_PLAYERS; i++){
     ShowPlayerNameTagForPlayer(i,playerid, true);}
     NameOff[playerid] = 0;
     SetPlayerName(playerid, plName[playerid]);
     SendClientMessage(playerid,COLOR_GREY,"You now have your real identity!");
     return 1;
    }
    }
  }
guess it'd work.


Re: Another problem... - Rks25 - 16.05.2009

what did you change ignas?

http://pastebin.com/d5f92b55a Try.


Re: Another problem... - FreeSoul - 16.05.2009

The name dissapears just for one second.
Then it comes back !


Re: Another problem... - FreeSoul - 16.05.2009

Bump !


Re: Another problem... - BP13 - 16.05.2009

your not allowed to bump


(neither am I lol)