• 18 Mai 2024, 01:55:43


Auteur Sujet: Problème accolade  (Lu 1135 fois)

0 Membres et 1 Invité sur ce sujet

Hors ligne jeje29140

  • *
  • Tueur
  • Messages: 67
    • Voir le profil
Problème accolade
« 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)

Hors ligne jeje29140

  • *
  • Tueur
  • Messages: 67
    • Voir le profil
Re : Problème accolade
« Réponse #1 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.

Hors ligne cristab

  • *
  • Messages: 8379
    • Voir le profil
Re : Problème accolade
« Réponse #2 le: 27 Mai 2012, 20:14:09 »
go le pastebin  :rules
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

vincentdu90

  • Invité
Re : Problème accolade
« Réponse #3 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 (problème d'affichage de Pastebin apparement , à moins que ça vienne de moi)
« Modifié: 27 Mai 2012, 20:40:05 par vincentdu90 »

Hors ligne jeje29140

  • *
  • Tueur
  • Messages: 67
    • Voir le profil
Re : Problème accolade
« Réponse #4 le: 28 Mai 2012, 12:51:00 »
Ah oui c'était bien ça!

Merci beaucoup mec ;)