GTAOnline.net

San Andreas Multiplayer (sa:mp) => Scripting SA-MP [Pawn center] => Discussion démarrée par: xEagl3Zx le 10 Septembre 2009, 12:47:03

Titre: FS Traduction Probleme ... aide SVP merci ...
Posté par: xEagl3Zx le 10 Septembre 2009, 12:47:03
Salut voila mon probleme ...

Errors :
C:Documents and SettingsAurélienBureauserver 1filterscripts rad.pwn(6) : warning 203: symbol is never used: "GoogleTranslate"
C:Documents and SettingsAurélienBureauserver 1filterscripts rad.pwn(6 -- 40) : error 013: no entry point (no public functions)
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.

Script :
//googletranslate.inc
//by 0rb (yom)
//26-04-09 14:06

GoogleTranslate(text[], from[], to[], size = sizeof text)
{
new
tmp[384],
idx = -1,
pos

;

while (text[++idx])
{
switch (text[idx])
{
case ' ' : tmp[idx] = '+';
default  : tmp[idx] = text[idx];
}
}

format(tmp, sizeof tmp, "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=%s&langpair=%s%%7C%s", tmp, from, to);
pwncurl_get(tmp, tmp, sizeof tmp);
  pos = strfind(tmp,"ext":"");
 
  if (pos != -1)
  {
strdel(tmp, 0, pos + 6);
strdel(tmp, strfind(tmp, ""}, "res"), sizeof tmp);
else
{
format(tmp, size, text);
}

return tmp;
}
Titre: Re : FS Traduction Probleme ... aide SVP merci ...
Posté par: FuSion le 10 Septembre 2009, 13:01:44
Traduit avec google traduction ?  ???


++
FS'
Titre: Re : FS Traduction Probleme ... aide SVP merci ...
Posté par: Ssk le 10 Septembre 2009, 13:08:53
en faites ajoute cette fonction sur ton gm ( a la fin)

GoogleTranslate(text[], from[], to[], size = sizeof text)
{
new
tmp[384],
idx = -1,
pos

;

while (text[++idx])
{
switch (text[idx])
{
case ' ' : tmp[idx] = '+';
default  : tmp[idx] = text[idx];
}
}

format(tmp, sizeof tmp, "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=%s&langpair=%s%%7C%s", tmp, from, to);
pwncurl_get(tmp, tmp, sizeof tmp);
  pos = strfind(tmp,"ext":"");
 
  if (pos != -1)
  {
strdel(tmp, 0, pos + 6);
strdel(tmp, strfind(tmp, ""}, "res"), sizeof tmp);
else
{
format(tmp, size, text);
}

return tmp;
}

et puis dans une cmd tu integre ca avec tes parametre
GoogleTranslate(text[], from[], to[], size = sizeof text);
Titre: Re : FS Traduction Probleme ... aide SVP merci ...
Posté par: MrFredo le 10 Septembre 2009, 13:11:02
J'ai modifier un peux la fonction car elle me generait des erreur vla la fonction qui marche correctement chez moi:
Code: (pawn) [Sélectionner]
stock GoogleTranslate(text[], from[], to[], size = sizeof(text))
{
new
tmp[384],
idx = -1,
pos
;
while (text[++idx])
{
switch (text[idx])
{
case ' ' : tmp[idx] = '+';
default  : tmp[idx] = text[idx];
}
}
format(tmp, sizeof tmp, "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=%s&langpair=%s%%7C%s", tmp, from, to);
pwncurl_get(tmp, tmp, sizeof tmp);
pos = strfind(tmp,"ext\":\"");
  if (pos != -1)
{
strdel(tmp, 0, pos + 6);
strdel(tmp, strfind(tmp, "\"}, \"res"), sizeof tmp);
}
else
{
format(tmp, size, text);
}
return tmp;
}
Titre: Re : FS Traduction Probleme ... aide SVP merci ...
Posté par: xEagl3Zx le 10 Septembre 2009, 18:46:24
Je peut savoir la commande ??

Double post
Rrrr Lol Aucune personne veut me repondre ou que se soit ...
Titre: Re : FS Traduction Probleme ... aide SVP merci ...
Posté par: Syg le 11 Septembre 2009, 12:01:21
warning 203: symbol is never used: "GoogleTranslate" : Veut dire que la fonction GoogleTranslate n'est jamais utilisée dans ton script (rad.pwn) mais qu'elle a été déclarée.
Solution :
Soit tu l'utilises dans une commande ou une autre fonction, soit tu fais précéder sa déclaration pas la mot clé stock comme te l'a montré MrFredo.

error 013: no entry point (no public functions) : Le compilateur ne trouve pas le point d'entrée (fonction principale) de ton gamemode.
Solution :
Tu as certainement oublié d'inclure a_samp.inc au début de ton gamemode
#include <a_samp>
NB : La fonction GoogleTranslate en elle même est correcte (même si la version de MrFredo est mieux).

++
Syg
Titre: Re : FS Traduction Probleme ... aide SVP merci ...
Posté par: xEagl3Zx le 11 Septembre 2009, 12:08:19
Euh Merci mais ... Comment je traduit en jeu exemple /trad en f hello => Trad : Salut ( bonjour ) or /trad en a Salut => Trad : Hello ... ?? Merci ... de m'aidez ...

++TZ++
Titre: Re : FS Traduction Probleme ... aide SVP merci ...
Posté par: Syg le 11 Septembre 2009, 12:17:11
Regarde le post de sasuke78200, il te montre comment utiliser cette fonction.

++
Syg
Titre: Re : FS Traduction Probleme ... aide SVP merci ...
Posté par: xEagl3Zx le 11 Septembre 2009, 18:06:59
Je comprend pas ... u_u ...
Titre: Re : FS Traduction Probleme ... aide SVP merci ...
Posté par: Ssk le 11 Septembre 2009, 18:16:18
Dans une commande tu met cette ligne avec tes parametres a toi


GoogleTranslate(text[], from[], to[], size = sizeof text);

par exemple

new str[128];
new Output[128];
GoogleTranslate(str,"Bonjour",Output, sizeof(str));
Titre: Re : FS Traduction Probleme ... aide SVP merci ...
Posté par: xEagl3Zx le 11 Septembre 2009, 18:22:48
Reuh ...

Errors:
C:\DOCUME~1\AURLIE~1\Bureau\SERVER~1\GAMEMO~1\drift1.pwn(2076) : warning 217: loose indentation
C:\DOCUME~1\AURLIE~1\Bureau\SERVER~1\GAMEMO~1\drift1.pwn(2080) : error 017: undefined symbol "text"
C:\DOCUME~1\AURLIE~1\Bureau\SERVER~1\GAMEMO~1\drift1.pwn(2080) : error 001: expected token: ",", but found "sizeof"
C:\DOCUME~1\AURLIE~1\Bureau\SERVER~1\GAMEMO~1\drift1.pwn(2080) : error 017: undefined symbol "text"
C:\DOCUME~1\AURLIE~1\Bureau\SERVER~1\GAMEMO~1\drift1.pwn(2080) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

Script :
  if(strcmp(cmdtext, "/trad", true, 5) == 0)
{
                                new str[128];
new Output[128];
                                GoogleTranslate(text[], from[], to[], size = sizeof(text))
return 1;
}

Titre: Re : FS Traduction Probleme ... aide SVP merci ...
Posté par: Ssk le 11 Septembre 2009, 18:28:47
met ca

GoogleTranslate(str,"Bonjour",Output, sizeof(str));
 a la place de ton googletranslate car la tu na pas mis tes parametres
Titre: Re : FS Traduction Probleme ... aide SVP merci ...
Posté par: xEagl3Zx le 11 Septembre 2009, 18:34:40
Je doit faire sa pour tout les mots ?? ... et ...

Errors :
C:\DOCUME~1\AURLIE~1\Bureau\SERVER~1\GAMEMO~1\drift1.pwn(2227) : error 017: undefined symbol "pwncurl_get"
C:\DOCUME~1\AURLIE~1\Bureau\SERVER~1\GAMEMO~1\drift1.pwn(2227) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.

Et il y a rien a cette ligne u_u" ...
Titre: Re : FS Traduction Probleme ... aide SVP merci ...
Posté par: Ssk le 11 Septembre 2009, 18:52:11
ta l' include de pawn_curl ???
Titre: Re : FS Traduction Probleme ... aide SVP merci ...
Posté par: xEagl3Zx le 11 Septembre 2009, 18:53:28
euh non u_u ><...
Titre: Re : FS Traduction Probleme ... aide SVP merci ...
Posté par: Ssk le 11 Septembre 2009, 19:00:24
béh télécharge la et sinon j' ai repondu a ton pb sur le bloquge des voitures
Titre: Re : FS Traduction Probleme ... aide SVP merci ...
Posté par: xEagl3Zx le 11 Septembre 2009, 20:31:35
Merci pour tout ton aide mais mon GM se lance pas xD ...  cause de sa ...

==============================================

Euh on ma dit que sa ne demarais pas parce que j'ai pas le plugin ...
Ou le trouver u_u ...
Merci ...

++TZ++

==============================================

Personne veut me dire ou le trouver ... parce que j'ai besoin de ce FS ... 
Titre: Re : FS Traduction Probleme ... aide SVP merci ...
Posté par: xEagl3Zx le 15 Septembre 2009, 19:12:50
donc comme sa personne sait ou il est mais vous aver reussit a mettre se truc u_u ... BIZARD lol ...

++TZ++
Titre: Re : FS Traduction Probleme ... aide SVP merci ...
Posté par: » Lukubi™ le 15 Septembre 2009, 19:36:05
Tu devrait peut-être aussi apprendre a chercher, on est pas tes chiens non plus  ::)


++
MrT®
Titre: Re : Re : FS Traduction Probleme ... aide SVP merci ...
Posté par: xEagl3Zx le 15 Septembre 2009, 19:44:45
Tu devrait peut-être aussi apprendre a chercher, on est pas tes chiens non plus  ::)


++
MrT®

Euh je n'est jamais dit que vous etiez mes chiens déjà et je vous parle correctement et je vous demande sa gentillement et je demande juste un peut d'aide ... donc ci tu n'est pas content ne vien pas sur le sujet et ses tout ... je n'est pas besoin de tels remarque pour qu'on m'aide ...  >:(
Titre: Re : FS Traduction Probleme ... aide SVP merci ...
Posté par: » Lukubi™ le 15 Septembre 2009, 19:47:17
Je voulait pas dire par chiens que tu nous parlait mal, mais que vu que tu avait la fleme de chercher tu voulait que l'on cherche a ta place ( c'est se que j'en déduit de ton dernier message ). Si tu aurait cherché tu aurait trouvé car cette include est très facile a trouver ...


++
MrT®
Titre: Re : FS Traduction Probleme ... aide SVP merci ...
Posté par: xEagl3Zx le 15 Septembre 2009, 19:51:53
Ok je te pardonne lool ... et je vais chercher mais je mais quoi un mot de clé u_u" ??
Titre: Re : FS Traduction Probleme ... aide SVP merci ...
Posté par: » Lukubi™ le 16 Septembre 2009, 13:48:37
C'est sur que c'est compliquer de taper le nom de l'inculde que l'on cherche dans google, aller tien sa ma pris exactement 2 secondes ...

Click (http://www.lmgtfy.com/?q=pwncurl)


++
MrT®
Titre: Re : FS Traduction Probleme ... aide SVP merci ...
Posté par: xEagl3Zx le 16 Septembre 2009, 14:40:45
Merci mais je savais pas qui fallait mettre sa ... xD