• 06 Juin 2026, 08:13:03


Auteur Sujet: petit probleme avec les cmd  (Lu 2005 fois)

0 Membres et 1 Invité sur ce sujet

Hors ligne Jerome02

  • *
  • Tueur en série
  • Messages: 211
    • Voir le profil
petit probleme avec les cmd
« le: 26 Août 2009, 19:05:34 »
bonjour a tous,


voila j'ai essayer d'ajouter un petit truque sur mon serveur stunt/race :

quand un joueurs fait par exemple /course1 bah sa dit a tous le monde %s a rejoint ma Map /course1 voila les cmd :

http://pastebin.com/m774e1273

et voila les erreur que je ne sais pas d'où elles vienne :(

C:Documents and SettingsAdministrateur.15C8C0122FFA4EFBureaulibertygamemodesStunt.pwn(1254) : error 017: undefined symbol "tmp"
C:Documents and SettingsAdministrateur.15C8C0122FFA4EFBureaulibertygamemodesStunt.pwn(1255) : error 017: undefined symbol "tmp"
C:Documents and SettingsAdministrateur.15C8C0122FFA4EFBureaulibertygamemodesStunt.pwn(1261) : error 017: undefined symbol "tmp"
C:Documents and SettingsAdministrateur.15C8C0122FFA4EFBureaulibertygamemodesStunt.pwn(1263) : error 017: undefined symbol "tmp"
C:Documents and SettingsAdministrateur.15C8C0122FFA4EFBureaulibertygamemodesStunt.pwn(1264) : error 017: undefined symbol "tmp"
C:Documents and SettingsAdministrateur.15C8C0122FFA4EFBureaulibertygamemodesStunt.pwn(1270) : error 017: undefined symbol "tmp"
C:Documents and SettingsAdministrateur.15C8C0122FFA4EFBureaulibertygamemodesStunt.pwn(1272) : error 017: undefined symbol "tmp"
C:Documents and SettingsAdministrateur.15C8C0122FFA4EFBureaulibertygamemodesStunt.pwn(1273) : error 017: undefined symbol "tmp"
C:Documents and SettingsAdministrateur.15C8C0122FFA4EFBureaulibertygamemodesStunt.pwn(1279) : error 017: undefined symbol "tmp"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


9 Errors.



Merci d'avance bonne journée


((** Débute dans le scripte mais connais deja pas mal de chose
mais beaucoup a apprendre encore :) **))

Hors ligne Ssk

  • *
  • Lulu's Stunt - Le serveur stunt de Lulu !
  • Messages: 8154
    • Voir le profil
Re : petit probleme avec les cmd
« Réponse #1 le: 26 Août 2009, 19:12:51 »
ajoute

new tmp[128];



Derrière tout programme se cache un programmeur, je considère le monde comme un programme.
Mon blog

Hors ligne Jerome02

  • *
  • Tueur en série
  • Messages: 211
    • Voir le profil
Re : petit probleme avec les cmd
« Réponse #2 le: 26 Août 2009, 21:20:57 »
je suis désole de te dire mais j'ai toujours les même erreur  :s


Aider moi s'il vous plait


((** Débute dans le scripte mais connais deja pas mal de chose
mais beaucoup a apprendre encore :) **))

Hors ligne Ssk

  • *
  • Lulu's Stunt - Le serveur stunt de Lulu !
  • Messages: 8154
    • Voir le profil
Re : petit probleme avec les cmd
« Réponse #3 le: 26 Août 2009, 21:39:58 »
dans quel callback apparaissent les erreur ?



Derrière tout programme se cache un programmeur, je considère le monde comme un programme.
Mon blog

Hors ligne Jerome02

  • *
  • Tueur en série
  • Messages: 211
    • Voir le profil
Re : petit probleme avec les cmd
« Réponse #4 le: 26 Août 2009, 21:44:44 »
public OnPlayerCommandText(playerid, cmdtext[])


((** Débute dans le scripte mais connais deja pas mal de chose
mais beaucoup a apprendre encore :) **))

Hors ligne Ssk

  • *
  • Lulu's Stunt - Le serveur stunt de Lulu !
  • Messages: 8154
    • Voir le profil
Re : petit probleme avec les cmd
« Réponse #5 le: 26 Août 2009, 21:52:29 »
ajoute
new tmp[128]; au debut de la callback



Derrière tout programme se cache un programmeur, je considère le monde comme un programme.
Mon blog

Hors ligne Jerome02

  • *
  • Tueur en série
  • Messages: 211
    • Voir le profil
Re : petit probleme avec les cmd
« Réponse #6 le: 26 Août 2009, 21:54:56 »
non enfaite les erreur vienne de la  :(


tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
return 1;
}
new car;
car = strval(tmp);
if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_GREY, "   vehicule compris entre 400 et 611 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
return 1;
}
new color1;
color1 = strval(tmp);
if(color1 < 0 || color1 > 300) { SendClientMessage(playerid, COLOR_GREY, "   couleur comprises entre 0 et 300 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
return 1;
}
new color2;
color2 = strval(tmp);


et quand j'ajoute new tmp[128] au début sa me donne sa :

C:\Documents and Settings\Administrateur.15C8C0122FFA4EF\Bureau\liberty\gamemodes\Stunt.pwn(959) : warning 219: local variable "tmp" shadows a variable at a preceding level
C:\Documents and Settings\Administrateur.15C8C0122FFA4EF\Bureau\liberty\gamemodes\Stunt.pwn(972) : warning 219: local variable "tmp" shadows a variable at a preceding level
C:\Documents and Settings\Administrateur.15C8C0122FFA4EF\Bureau\liberty\gamemodes\Stunt.pwn(988) : warning 219: local variable "tmp" shadows a variable at a preceding level
C:\Documents and Settings\Administrateur.15C8C0122FFA4EF\Bureau\liberty\gamemodes\Stunt.pwn(1004) : warning 219: local variable "tmp" shadows a variable at a preceding level
C:\Documents and Settings\Administrateur.15C8C0122FFA4EF\Bureau\liberty\gamemodes\Stunt.pwn(1017) : warning 219: local variable "tmp" shadows a variable at a preceding level
C:\Documents and Settings\Administrateur.15C8C0122FFA4EF\Bureau\liberty\gamemodes\Stunt.pwn(1030) : warning 219: local variable "tmp" shadows a variable at a preceding level
C:\Documents and Settings\Administrateur.15C8C0122FFA4EF\Bureau\liberty\gamemodes\Stunt.pwn(1043) : warning 219: local variable "tmp" shadows a variable at a preceding level
C:\Documents and Settings\Administrateur.15C8C0122FFA4EF\Bureau\liberty\gamemodes\Stunt.pwn(1056) : warning 219: local variable "tmp" shadows a variable at a preceding level
C:\Documents and Settings\Administrateur.15C8C0122FFA4EF\Bureau\liberty\gamemodes\Stunt.pwn(1069) : warning 219: local variable "tmp" shadows a variable at a preceding level
C:\Documents and Settings\Administrateur.15C8C0122FFA4EF\Bureau\liberty\gamemodes\Stunt.pwn(1082) : warning 219: local variable "tmp" shadows a variable at a preceding level
C:\Documents and Settings\Administrateur.15C8C0122FFA4EF\Bureau\liberty\gamemodes\Stunt.pwn(1095) : warning 219: local variable "tmp" shadows a variable at a preceding level
C:\Documents and Settings\Administrateur.15C8C0122FFA4EF\Bureau\liberty\gamemodes\Stunt.pwn(1108) : warning 219: local variable "tmp" shadows a variable at a preceding level
C:\Documents and Settings\Administrateur.15C8C0122FFA4EF\Bureau\liberty\gamemodes\Stunt.pwn(1121) : warning 219: local variable "tmp" shadows a variable at a preceding level
C:\Documents and Settings\Administrateur.15C8C0122FFA4EF\Bureau\liberty\gamemodes\Stunt.pwn(1134) : warning 219: local variable "tmp" shadows a variable at a preceding level
C:\Documents and Settings\Administrateur.15C8C0122FFA4EF\Bureau\liberty\gamemodes\Stunt.pwn(1147) : warning 219: local variable "tmp" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


15 Warnings.


((** Débute dans le scripte mais connais deja pas mal de chose
mais beaucoup a apprendre encore :) **))

Hors ligne cristab

  • *
  • Messages: 8379
    • Voir le profil
Re : petit probleme avec les cmd
« Réponse #7 le: 26 Août 2009, 22:52:52 »
comme sa

public OnPlayerCommandText(playerid, cmdtext[])
{
   new tmp[256];

   //ensuite t'es commandes
   return 0;
}
pas d'aide en PM, vous êtes sur un forum est il me semble que vous êtes la pour avoir de l'aide donc pourquoi MP une seul personne qui ne vous répondra pas alors qu'il y a plein de membre ici

Hors ligne Jerome02

  • *
  • Tueur en série
  • Messages: 211
    • Voir le profil
Re : petit probleme avec les cmd
« Réponse #8 le: 26 Août 2009, 23:07:32 »
oui avant cette comme sa  :(


((** Débute dans le scripte mais connais deja pas mal de chose
mais beaucoup a apprendre encore :) **))

Hors ligne ApocKalipsS

  • *
  • Gangster
  • **** | Une experience GTA IV hors du commun !
  • Messages: 1141
    • Voir le profil
Re : petit probleme avec les cmd
« Réponse #9 le: 27 Août 2009, 11:12:21 »
local variable "tmp" shadows a variable at a preceding level

Cela veut dire que tu as déjà un "new tmp" quelque part au dessus de ton script, enlève la.

Hors ligne Jerome02

  • *
  • Tueur en série
  • Messages: 211
    • Voir le profil
Re : petit probleme avec les cmd
« Réponse #10 le: 27 Août 2009, 23:02:49 »
j'ai plus d'erreur mais la le problème c'est que il y a que l'id qui apparais :s voila la commandes :

if(strcmp(cmdtext, "/drift2", true) == 0)
{
new tmp[128];
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,-2403.4817,-601.5650,132.6484);
SetPlayerArmour(playerid, 100.0);
SetPlayerHealth(playerid, 100.0);
ResetPlayerWeapons(playerid);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Bienvenue à Drift 2!");
format(tmp, sizeof(tmp), "Le joueur %s[%d] vient de rejoindre la map /Drift2", tmp, playerid);
SendClientMessageToAll(COLOR_BLUE, tmp);
return 1;
}


Merci d'avance bonne soirée




((** Débute dans le scripte mais connais deja pas mal de chose
mais beaucoup a apprendre encore :) **))

Hors ligne cristab

  • *
  • Messages: 8379
    • Voir le profil
Re : petit probleme avec les cmd
« Réponse #11 le: 27 Août 2009, 23:13:20 »
la dans ta cmd il y rien qui retieent le nom du joueur comme la fonction GetPlayerName.
pas d'aide en PM, vous êtes sur un forum est il me semble que vous êtes la pour avoir de l'aide donc pourquoi MP une seul personne qui ne vous répondra pas alors qu'il y a plein de membre ici

Hors ligne ApocKalipsS

  • *
  • Gangster
  • **** | Une experience GTA IV hors du commun !
  • Messages: 1141
    • Voir le profil
Re : petit probleme avec les cmd
« Réponse #12 le: 28 Août 2009, 09:20:34 »
GetPlayerName(playerid, tmp, sizeof(tmp));   :D