GTAOnline.net

San Andreas Multiplayer (sa:mp) => Scripting SA-MP [Pawn center] => Discussion démarrée par: Jerome02 le 26 Août 2009, 19:05:34

Titre: petit probleme avec les cmd
Posté par: Jerome02 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 (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
Titre: Re : petit probleme avec les cmd
Posté par: Ssk le 26 Août 2009, 19:12:51
ajoute

new tmp[128];
Titre: Re : petit probleme avec les cmd
Posté par: Jerome02 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
Titre: Re : petit probleme avec les cmd
Posté par: Ssk le 26 Août 2009, 21:39:58
dans quel callback apparaissent les erreur ?
Titre: Re : petit probleme avec les cmd
Posté par: Jerome02 le 26 Août 2009, 21:44:44
public OnPlayerCommandText(playerid, cmdtext[])
Titre: Re : petit probleme avec les cmd
Posté par: Ssk le 26 Août 2009, 21:52:29
ajoute
new tmp[128]; au debut de la callback
Titre: Re : petit probleme avec les cmd
Posté par: Jerome02 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.
Titre: Re : petit probleme avec les cmd
Posté par: cristab le 26 Août 2009, 22:52:52
comme sa

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

   //ensuite t'es commandes
   return 0;
}
Titre: Re : petit probleme avec les cmd
Posté par: Jerome02 le 26 Août 2009, 23:07:32
oui avant cette comme sa  :(
Titre: Re : petit probleme avec les cmd
Posté par: ApocKalipsS 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.
Titre: Re : petit probleme avec les cmd
Posté par: Jerome02 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


Titre: Re : petit probleme avec les cmd
Posté par: cristab 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.
Titre: Re : petit probleme avec les cmd
Posté par: ApocKalipsS le 28 Août 2009, 09:20:34
GetPlayerName(playerid, tmp, sizeof(tmp));   :D