GTAOnline.net

San Andreas Multiplayer (sa:mp) => Scripting SA-MP [Pawn center] => Discussion démarrée par: Lychaos le 21 Août 2010, 11:48:48

Titre: Probleme avec ShowPlayerNameTagForPlayer
Posté par: Lychaos le 21 Août 2010, 11:48:48
Bonjour
Voila, j'ai recuper la commande de /mask qu'il y avait dans le LARP pour le mettre sur mon GM, je ne sais pas si sa viens du GM, ou de samp, mais cette commande ne marche plus.
Le fait est, que quand on tape la commande, on voit le nom disparaitre, et hop, tout de suite apres il revient..

Sauriez vous d'ou cela provient ?
(voila le code :
Code: (pawn) [Sélectionner]
if(strcmp(cmd, "/nomoff", true) == 0) // by LordMan
{
if(IsPlayerConnected(playerid))
      {
if(PlayerInfo[playerid][pNomoff] == 0)
{
if(PlayerInfo[playerid][pLevel] >=5)
{
for(new i = 0; i < MAX_PLAYERS; i++)
    {
    ShowPlayerNameTagForPlayer(i, playerid, 0);
      }
PlayerInfo[playerid][pNomoff] = 1;
SendClientMessage(playerid, COLOR_WHITE, "   Vous etes en nom off [Pour le remettre /nomon ].");
GetPlayerName(playerid, sendername, sizeof(sendername));
      format(string, sizeof(string), "* Une personne devient meconaissable");
      ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
else
{
    SendClientMessage(playerid, COLOR_WHITE, "Vous etes deja en nomoff!.");
    return 1;
    }
}
return 1;
}
Titre: Re : Probleme avec ShowPlayerNameTagForPlayer
Posté par: Leonidas300 le 21 Août 2010, 12:18:07
Code: (pawn) [Sélectionner]
if(strcmp(cmd, "/masqueon", true) == 0) // by Ellis
{
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pMask] == 0)
    {
         SendClientMessage(playerid, COLOR_GRAD1, "   Vous n'avez pas un masque");
         return 1;
    }
    if(PlayerInfo[playerid][pLevel] < 5)
    {
        SendClientMessage(playerid, COLOR_GRAD1, "  Vous ne pouvez pas l'employer.");
        return 1;
    }
for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
    ShowPlayerNameTagForPlayer(i, playerid, 0);
}
}
PlayerInfo[playerid][pMaskuse] = 1;
SendClientMessage(playerid, COLOR_WHITE, "   Vous avez mis votre masque [/masqueoff pour l'enlever].");
GetPlayerName(playerid, sendername, sizeof(sendername));
      format(string, sizeof(string), "* %s met son masque.", sendername);
      ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
return 1;
}

if(strcmp(cmd, "/masqueoff", true) == 0) // by Ellis
{
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pMask] == 0)
    {
        SendClientMessage(playerid, COLOR_GRAD1, "   Vous n'avez pas de masque");
        return 1;
    }
    if(PlayerInfo[playerid][pLevel] < 5)
    {
        SendClientMessage(playerid, COLOR_GRAD1, "  Vous ne pouvez pas l'employer.");
        return 1;
    }
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
    ShowPlayerNameTagForPlayer(i, playerid, 1);
}
}
PlayerInfo[playerid][pMaskuse] = 0;
SendClientMessage(playerid, COLOR_WHITE, "Vous avez enlever votre masque [/masqueon pour le remettre].");
GetPlayerName(playerid, sendername, sizeof(sendername));
      format(string, sizeof(string), "* %s enleve son masque.", sendername);
      ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
return 1;
}
Titre: Re : Probleme avec ShowPlayerNameTagForPlayer
Posté par: Lychaos le 21 Août 2010, 14:49:42
meme en changeant cela, le nom part 1 seconde, et reviens juste apres...
Titre: Re : Probleme avec ShowPlayerNameTagForPlayer
Posté par: Eloctro le 21 Août 2010, 18:58:36
Ce bug mais déja arriver il est très étrange je pensse que ça vient de sa-mp essaye avec la 0.3b c'est peut être corrigé
Titre: Re : Probleme avec ShowPlayerNameTagForPlayer
Posté par: Ssk le 21 Août 2010, 19:33:14
Ou peut être que dans un de tes FS ça affiche le nom xD

je sais pas trop ^^
Titre: Re : Probleme avec ShowPlayerNameTagForPlayer
Posté par: Lychaos le 21 Août 2010, 19:55:07
Ouai j'avais penser a cela Sasuke, surement le GL_realtime  ou un truk du genre, mais j'ai jamais regarde, la version 0.3b bug chez moi, pas vous ? ( INCORRECT VERSION -> j'ai mit a jour serveur + client )
Titre: Re : Probleme avec ShowPlayerNameTagForPlayer
Posté par: Lychaos le 24 Août 2010, 16:57:38
Bon, meme apres être passer en 0.3, le bug persiste, je comprend vraiment pas pourquoi, quelqu'un aurait trouvé la solution ?
Titre: Re : Probleme avec ShowPlayerNameTagForPlayer
Posté par: dydjyz le 24 Août 2010, 23:24:16
Salut, étant en 0.3b, je viens de tester et sa marche,
j'ai créer un public, teste comme sa:

forward DontShow(playerid);
public DontShow(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
ShowPlayerNameTagForPlayer(i, playerid, 0);
}
}


DontShow(playerid); dans ton code

Chuss, DydjyZ, comme le tonerre.
Titre: Re : Probleme avec ShowPlayerNameTagForPlayer
Posté par: Lychaos le 25 Août 2010, 14:37:04
Ah, faire la commande via une fonction, ouai je vais esseyer , merci
Titre: Re : Probleme avec ShowPlayerNameTagForPlayer
Posté par: dydjyz le 25 Août 2010, 14:52:38
Previens moi si elle marche ou pas, en tout cas pour moi elle marche,
néamoins apres avoir tapper la commande il faut atendre 3-4 seconde avant d'etre en nomoff

je sait pas si sa viens de chez moi ou ... enfin voilà quoi

Chuss, DydjyZ comme le tonerre.
Titre: Re : Probleme avec ShowPlayerNameTagForPlayer
Posté par: Lychaos le 26 Août 2010, 16:33:31
Bonjour

Non, cela ne marche toujours pas.. le nom disparait 1 seconde puis reviens, donc il y a une fonction ( surement tout les demie/1 seconde ) que réafiche le nom.. mais je ne comprend pas, car dans le GM je n'ai aucune ShowPlayerNameTagForPlayer ni ShowPlayerNameet meme en enlevant les FS j'ai ce bug ...
Titre: Re : Probleme avec ShowPlayerNameTagForPlayer
Posté par: dydjyz le 26 Août 2010, 17:21:52
Apres avoit appeler DontShow, il faut attendre 2-3 secondes avant que le nom disparaisse, ta regarder dans tes includes si il y a Le Show... ?
Titre: Re : Probleme avec ShowPlayerNameTagForPlayer
Posté par: Lychaos le 27 Août 2010, 21:29:57
Ouai, j'ai deja regarder
Titre: Re : Probleme avec ShowPlayerNameTagForPlayer
Posté par: Blackdown le 01 Février 2011, 22:35:14
Bonsoir,

Désolé de up ce sujet un peut ancien mais j'ai exactement le même problème. Le pseudo disparait 1 ou 2 secondes et réapparait après.

Voila ma commande:

if (strcmp("/nameoff", cmdtext, true) == 0)
{
if(IsPlayerConnected(playerid))
    {
for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
    ShowPlayerNameTagForPlayer(i, playerid, 0);
}
}
}
}

En attente de la réponse.

Cordialement