GTAOnline.net

San Andreas Multiplayer (sa:mp) => Scripting SA-MP [Pawn center] => Discussion démarrée par: .:: Miguel .:: le 27 Juin 2011, 20:23:00

Titre: Bug pname
Posté par: .:: Miguel .:: le 27 Juin 2011, 20:23:00
Salut,
J'ai créé un pname qui envoie un message au admins quand le joueur exécute la cmds mais quand j'ai voulu faire au joueur quand il le tue sa dit    l'admins %s vous ah tuez sa pause problème.

CMDS

<?php
dcmd_akill
(playeridparams[])
{
    new 
id;
if (strlen(params))
if(PlayerInfo[playerid][pAdminLevel] == 1)
    {

id strval(params);
if (IsPlayerConnected(id))
{
SetPlayerHealth(id0.0);
            new 
pname[MAX_PLAYER_NAME], string[22 MAX_PLAYER_NAME];
            
GetPlayerName(playeridpnamesizeof(pname));
            
format(stringsizeof(string), "%s vien de vous tuez",id,pname);
            
SendClientMessage(playeridCOLOR_ORANGE,string,1);
            new 
pname[MAX_PLAYER_NAME], string[22 MAX_PLAYER_NAME];
            
GetPlayerName(playeridpnamesizeof(pname));
            
format(stringsizeof(string), "AdmCmd: %s tue %s",id,pname);
            
SendAdminMessage(COLOR_ADMINS,string,1);
            }
}
       else
      {
  SendClientMessage(playeridCOLOR_RED"Vous avez pas le level pour cette commande.");
      }

else
{
SendClientMessage(playeridCOLOR_RED"Joueur non connecté");
}
}
Titre: Re : Bug pname
Posté par: Gilux le 27 Juin 2011, 20:25:29
"format(string, sizeof(string), "AdmCmd: %s tue %s",id,pname);"

Tu formates la variable id en tant que phrase alors que c'est un entier ;)

++
Titre: Re : Bug pname
Posté par: .:: Miguel .:: le 27 Juin 2011, 20:28:22
Quelqu'un peux la coriggé j'ai remarqué quel bugait  :-[

Sinan le bug réglés