• 03 Mai 2025, 01:18:23


Auteur Sujet: Besoin d'aide pour mon /gouv  (Lu 680 fois)

0 Membres et 1 Invité sur ce sujet

Hors ligne dydjyz

  • *
  • Bandit
  • Messages: 278
    • Voir le profil
    • OriginalRP - SAMP
Besoin d'aide pour mon /gouv
« le: 23 Août 2010, 12:21:00 »
Bonjour,

je vous explique mon probleme, quand je fait par exemple /gouv toto
sa affiche

|_______________________ GOUVERNEMENT _______________________|
Policier Dylan_Dean dit:
|_______________________ GOUVERNEMENT _______________________|



Et sa n'affiche pas se que je dit, je pense que cela viens de la variable message:


  if(strcmp(cmd, "/gouv", true) == 0)
{
if(stats[playerid][Faction] == 1)
{
tmp = strtok(cmdtext, idx);
new message;
message = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFF0000FF, "USAGE: /Gouv [Message]");
return 1;
}
if (strlen(tmp))
{

  new string[56];
  new string2[56];
  new string3[56];
new nomdujoueur[MAX_PLAYER_NAME];
    GetPlayerName(playerid, nomdujoueur, sizeof(nomdujoueur));
  format(string, sizeof(string), "|___________________ GOUVERNEMENT ___________________|");
  format(string2, sizeof(string2), "Policier %s: %s",nomdujoueur, message);
  format(string3, sizeof(string3), "|___________________ GOUVERNEMENT ___________________|");
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
SendClientMessageToAll(COLOR_WHITE, string2);
SendClientMessageToAll(COLOR_LIGHTBLUE, string3);
}
}
}

Merci de votre aide.

Hors ligne Brian Turner

  • PAWN/PHP/SQL/MAP/SQUIRIEL
  • *
  • Bandit
  • Messages: 438
    • Voir le profil
Re : Besoin d'aide pour mon /gouv
« Réponse #1 le: 23 Août 2010, 12:59:15 »
Bonjour,

je vous explique mon probleme, quand je fait par exemple /gouv toto
sa affiche

|_______________________ GOUVERNEMENT _______________________|
Policier Dylan_Dean dit:
|_______________________ GOUVERNEMENT _______________________|



Et sa n'affiche pas se que je dit, je pense que cela viens de la variable message:


  if(strcmp(cmd, "/gouv", true) == 0)
{
if(stats[playerid][Faction] == 1)
{
tmp = strtok(cmdtext, idx);
new message;
message = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFF0000FF, "USAGE: /Gouv [Message]");
return 1;
}
if (strlen(tmp))
{

   new string[56];
   new string2[56];
   new string3[56];
new nomdujoueur[MAX_PLAYER_NAME];
   GetPlayerName(playerid, nomdujoueur, sizeof(nomdujoueur));
   format(string, sizeof(string), "|___________________ GOUVERNEMENT ___________________|");
   format(string2, sizeof(string2), "Policier %s: %s",nomdujoueur, message);
   format(string3, sizeof(string3), "|___________________ GOUVERNEMENT ___________________|");
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
SendClientMessageToAll(COLOR_WHITE, string2);
SendClientMessageToAll(COLOR_LIGHTBLUE, string3);
}
}
}

Merci de votre aide.

salut, déjà sa sers a rien de faire des variables puis les formater pour "|___________________ GOUVERNEMENT ___________________|" tu fait
Code: (pawn) [Sélectionner]
 if(strcmp(cmd, "/gouv", true) == 0)
{
if(stats[playerid][Faction] == 1)
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, 0xFF0000FF, "USAGE: /Gouv [Message]");
return 1;
}
   new string[256];
new nomdujoueur[MAX_PLAYER_NAME];
   GetPlayerName(playerid, nomdujoueur, sizeof(nomdujoueur));
   SendClientMessageToAll(COLOR_LIGHTBLUE,  "|___________________ GOUVERNEMENT ___________________|");
   format(string2, sizeof(string2), "Policier %s: %s",nomdujoueur, result);
     SendClientMessageToAll(COLOR_WHITE, string);
   SendClientMessageToAll(COLOR_LIGHTBLUE,  "|___________________ GOUVERNEMENT ___________________|");

}
}
« Modifié: 23 Août 2010, 13:01:48 par Brian Turner »
Momoto33127
__________________________________________
[TRADUCTION][FS]Celular call 1.5 : Voir le poste
[ADDON/INC]Motor System (/clef et /vsortir pour Gveh) : Voir le poste
[FS]BanList (BlackListe) [Systeme de BAN] : Voir le poste

Hors ligne dydjyz

  • *
  • Bandit
  • Messages: 278
    • Voir le profil
    • OriginalRP - SAMP
Re : Besoin d'aide pour mon /gouv
« Réponse #2 le: 23 Août 2010, 13:43:21 »
Merciii sa marche, sortie de mon gm version 0.3 prochaine x)

Hors ligne Brian Turner

  • PAWN/PHP/SQL/MAP/SQUIRIEL
  • *
  • Bandit
  • Messages: 438
    • Voir le profil
Re : Besoin d'aide pour mon /gouv
« Réponse #3 le: 23 Août 2010, 13:54:50 »
Je suis content pour toi que sa marche.
Momoto33127
__________________________________________
[TRADUCTION][FS]Celular call 1.5 : Voir le poste
[ADDON/INC]Motor System (/clef et /vsortir pour Gveh) : Voir le poste
[FS]BanList (BlackListe) [Systeme de BAN] : Voir le poste