GTAOnline.net

San Andreas Multiplayer (sa:mp) => Problèmes et bugs => Discussion démarrée par: jeje29140 le 27 Mai 2012, 14:30:34

Titre: Problème accolade
Posté par: jeje29140 le 27 Mai 2012, 14:30:34
Bonjour à tous,


J'ai un problème au niveau de mon code, sa me met 26 erreurs et je pense que c'est un problème d'accolade.

Voici mon code: if(listitem == 0)
{
if(PlayerInfo[playerid][pTraderPerk] > 0)
    {
new skill = 150 / 100;
new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
new payout = 150 - price;
        format(string, sizeof(string), "~r~-$%d", payout);
GameTextForPlayer(playerid, string, 5000, 1);
SafeGivePlayerMoney(playerid,- payout);
SBizzInfo[9][sbTill] += payout;
ExtortionSBiz(9, payout);
    }
    else
    {
        format(string, sizeof(string), "~r~-$%d", 150);
GameTextForPlayer(playerid, string, 5000, 1);
SafeGivePlayerMoney(playerid,-150);
SBizzInfo[9][sbTill] += 150;
ExtortionSBiz(9, 150);
    }
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
new randphone = 1000 + random(9999);//minimum 1000  max 9999
PlayerInfo[playerid][pPnumber] = randphone;
format(string, sizeof(string), "Telephone acheté, votre numéro est le %d", randphone);
SendClientMessage(playerid, COLOR_GRAD4, string);
SendClientMessage(playerid, COLOR_GRAD5, "Vous pouvez le vérifier à tout moment en tappant /stats");
SendClientMessage(playerid, COLOR_WHITE, "Note: Vous pouvez utiliser /aide pour voir les commande du telephone.");
}
if(listitem == 1)
Titre: Re : Problème accolade
Posté par: jeje29140 le 27 Mai 2012, 14:50:40
Désolé.

la commande pour acheter:

if (strcmp("/acheter", cmdtext, true, 10) == 0 || strcmp(cmd, "/acheterarme", true) == 0) // Menu aide Armes
{
if(PlayerInfo[playerid][pLevel] < 3)
             {
             return SendClientMessage(playerid, COLOR_GRAD1, "Vous devez être minimum Level 3 pour pouvoir acheter des armes.");
             }
             if (!PlayerToPoint(100, playerid, -30.875, -88.9609, 1004.53))
{
         return SendClientMessage(playerid, COLOR_GRAD2, "Vous n'êtes pas dans le magasin");
}
ShowPlayerDialog(playerid,magasin,DIALOG_STYLE_LIST,"Magasin","Telephone  [100$]\nCarte à gratter\ncagoule\npied de biche\ncouteau\n","Valider","Fermer");
return 1;
}





Menu:

if(dialogid == magasin)
    {
  if(response)
{
  if(listitem == 0)
{
if(PlayerInfo[playerid][pTraderPerk] > 0)
    {
new skill = 150 / 100;
new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
new payout = 150 - price;
        format(string, sizeof(string), "~r~-$%d", payout);
GameTextForPlayer(playerid, string, 5000, 1);
SafeGivePlayerMoney(playerid,- payout);
SBizzInfo[9][sbTill] += payout;
ExtortionSBiz(9, payout);
    }
    else
    {
        format(string, sizeof(string), "~r~-$%d", 150);
GameTextForPlayer(playerid, string, 5000, 1);
SafeGivePlayerMoney(playerid,-150);
SBizzInfo[9][sbTill] += 150;
ExtortionSBiz(9, 150);
    }
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
new randphone = 1000 + random(9999);//minimum 1000  max 9999
PlayerInfo[playerid][pPnumber] = randphone;
format(string, sizeof(string), "Telephone acheté, votre numéro est le %d", randphone);
SendClientMessage(playerid, COLOR_GRAD4, string);
SendClientMessage(playerid, COLOR_GRAD5, "Vous pouvez le vérifier à tout moment en tappant /stats");
SendClientMessage(playerid, COLOR_WHITE, "Note: Vous pouvez utiliser /aide pour voir les commande du telephone.");
}
if(listitem == 1)
{
SendClientMessage(playerid, COLOR_GREEN, "a voir apres");
  }
if(listitem == 2)
{
SendClientMessage(playerid, COLOR_GREEN, "a voir apres");
}
if(listitem == 3)
{
SendClientMessage(playerid, COLOR_GREEN, "a voir apres");
}
if(listitem == 4)
{
SendClientMessage(playerid, COLOR_GREEN, "a voir apres");
}
   }


Et l'erreur comme dit précédemment, c'est le fameux 26 erreurs:

C:\Users\Jeremy\Documents\Gta\samp\pawno\include\radar.inc(576) : error 004: function "OnPlayerFlashed" is not implemented
C:\Users\Jeremy\Documents\Gta\samp\pawno\include\JunkBuster.inc(2919) : warning 201: redefinition of constant/macro (symbol "OnPlayerConnect")
C:\Users\Jeremy\Documents\Gta\samp\pawno\include\JunkBuster.inc(2920) : warning 201: redefinition of constant/macro (symbol "OnPlayerDisconnect")
C:\Users\Jeremy\Documents\Gta\samp\pawno\include\JunkBuster.inc(2921) : warning 201: redefinition of constant/macro (symbol "OnGameModeInit")
C:\Users\Jeremy\Documents\Gta\samp\gamemodes\cvdl-rp.pwn(4977) : error 017: undefined symbol "ShamalExists"
C:\Users\Jeremy\Documents\Gta\samp\gamemodes\cvdl-rp.pwn(4979) : error 017: undefined symbol "CreateShamalInt"
C:\Users\Jeremy\Documents\Gta\samp\gamemodes\cvdl-rp.pwn(4981) : error 017: undefined symbol "SetPlayerPosInShamal"
C:\Users\Jeremy\Documents\Gta\samp\gamemodes\cvdl-rp.pwn(5781) : error 017: undefined symbol "AntiFlood_InitPlayer"
C:\Users\Jeremy\Documents\Gta\samp\gamemodes\cvdl-rp.pwn(6692) : error 004: function "Bombardement" is not implemented
C:\Users\Jeremy\Documents\Gta\samp\gamemodes\cvdl-rp.pwn(6771) : error 004: function "endrace" is not implemented
C:\Users\Jeremy\Documents\Gta\samp\gamemodes\cvdl-rp.pwn(6775) : error 004: function "ReadyRefresh" is not implemented
C:\Users\Jeremy\Documents\Gta\samp\gamemodes\cvdl-rp.pwn(6784) : error 004: function "b" is not implemented
C:\Users\Jeremy\Documents\Gta\samp\gamemodes\cvdl-rp.pwn(6786) : error 004: function "b" is not implemented
C:\Users\Jeremy\Documents\Gta\samp\gamemodes\cvdl-rp.pwn(6787) : error 004: function "b" is not implemented
C:\Users\Jeremy\Documents\Gta\samp\gamemodes\cvdl-rp.pwn(6788) : error 004: function "b" is not implemented
C:\Users\Jeremy\Documents\Gta\samp\gamemodes\cvdl-rp.pwn(6790) : error 004: function "b" is not implemented
C:\Users\Jeremy\Documents\Gta\samp\gamemodes\cvdl-rp.pwn(7117) : error 004: function "ConvertirTexte" is not implemented
C:\Users\Jeremy\Documents\Gta\samp\gamemodes\cvdl-rp.pwn(7305) : error 017: undefined symbol "AntiFlood_Check"
C:\Users\Jeremy\Documents\Gta\samp\gamemodes\cvdl-rp.pwn(7665) : error 017: undefined symbol "UnderscoreToSpace"
C:\Users\Jeremy\Documents\Gta\samp\gamemodes\cvdl-rp.pwn(9577) : error 004: function "GetLapTick" is not implemented
C:\Users\Jeremy\Documents\Gta\samp\gamemodes\cvdl-rp.pwn(9578) : error 004: function "GetRaceTick" is not implemented
C:\Users\Jeremy\Documents\Gta\samp\gamemodes\cvdl-rp.pwn(9581) : error 004: function "RaceSound" is not implemented
C:\Users\Jeremy\Documents\Gta\samp\gamemodes\cvdl-rp.pwn(9588) : error 017: undefined symbol "BeHuman"
C:\Users\Jeremy\Documents\Gta\samp\gamemodes\cvdl-rp.pwn(9588) : error 033: array must be indexed (variable "LapString")
C:\Users\Jeremy\Documents\Gta\samp\gamemodes\cvdl-rp.pwn(9589) : error 017: undefined symbol "BeHuman"
C:\Users\Jeremy\Documents\Gta\samp\gamemodes\cvdl-rp.pwn(9589) : error 033: array must be indexed (variable "RaceString")
C:\Users\Jeremy\Documents\Gta\samp\gamemodes\cvdl-rp.pwn(9592) : error 004: function "CheckBestLap" is not implemented
C:\Users\Jeremy\Documents\Gta\samp\gamemodes\cvdl-rp.pwn(9597) : error 004: function "CheckBestRace" is not implemented
C:\Users\Jeremy\Documents\Gta\samp\gamemodes\cvdl-rp.pwn(9620) : error 004: function "endrace" is not implemented

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


26 Errors.
Titre: Re : Problème accolade
Posté par: cristab le 27 Mai 2012, 20:14:09
go le pastebin  :rules (http://www.gtaonline.fr/forums/index.php/topic,12060.0.html)
Titre: Re : Problème accolade
Posté par: vincentdu90 le 27 Mai 2012, 20:22:34
Il manquait l'accolade qui refermait la condition " if(response)".

Voilà le code , je t'ai mis la ligne de l'erreur. Je te conseilles vivement d'identiter ton code à l'avenir, ça te permettra de retrouver très vite une accolade manquante (sur un petit code).

http://pastebin.com/B7iMuJVN (http://pastebin.com/B7iMuJVN) (problème d'affichage de Pastebin apparement , à moins que ça vienne de moi)
Titre: Re : Problème accolade
Posté par: jeje29140 le 28 Mai 2012, 12:51:00
Ah oui c'était bien ça!

Merci beaucoup mec ;)