SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 31/07/2020, 03:59 PM   #1
Erwan
Big Clucker
 
Erwan's Avatar
 
Join Date: Jun 2013
Posts: 77
Reputation: 0
Default Errors

Hello,

Can i help with this errors ?

https://pastebin.com/CW5AWPTm
__________________
Erwan is offline   Reply With Quote
Old 31/07/2020, 04:04 PM   #2
XGreen
Huge Clucker
 
XGreen's Avatar
 
Join Date: May 2014
Location: Manila
Posts: 207
Reputation: 8
Default Re: Errors

Keyword Mapping isnt defined.

PHP Code:
#define Mapping 300 //use any number 
Add that next to your defines.


EDIT: You also missed a closing bracket. AND didnt change the dialogid to listitem.

PHP Code:
case Mapping// ligne 1106
{
    if(
response)
    {
        switch(
listitem)
        {
            case 
0:
            {
            
SetPlayerPos(playerid, -203.877842305.74927701.74390);
            
SendClientMessage(playerid, -1"{868A08}[Info]{AEB404} Bienvenue dans le Bar/Tabac de Florentin");
            }

            case 
1:
            {
            
SetPlayerPos(playerid2519.5601, -1293.7400995.8500);
            
SendClientMessage(playerid, -1"{868A08}[Info]{AEB404} Bienvenue dans l'ancienne base secrète WPS !");
            }

            case 
2:
            {
            
SetPlayerPos(playerid, -1633.9410,670.5158,-5.2399);
            
SendClientMessage(playerid, -1"{868A08}[Info]{AEB404} Bienvenue au Stand de Tir de la SFPD");
            }

            case 
3:
            {
            
SetPlayerPos(playerid, -1806.37992.70444.9609);
            
SendClientMessage(playerid, -1"{868A08}[Info]{AEB404} Bienvenue au quartier CRIPS");
            }

            case 
4:
            {
            
SetPlayerPos(playerid, -2127.2285,-64.5489,35.3203);
            
SendClientMessage(playerid, -1"{868A08}[Info]{AEB404} Bienvenue au quartier BLOODS");
            }

            case 
5:
            {
            
SetPlayerPos(playerid, -2101.1367,56.6571,35.3203);
            
SendClientMessage(playerid, -1"{868A08}[Info]{AEB404} Bienvenue au CyberCafé : Extérieur");
            }

            case 
6:
            {
            
SetPlayerPos(playerid, -383.0371,1502.3716,801.8282);
            
SendClientMessage(playerid, -1"{868A08}[Info]{AEB404} Bienvenue au CyberCafé : Intérieur");
            }

            case 
7:
            {
            
SetPlayerPos(playerid374.2582,2840.0972,501.5304);
            
SendClientMessage(playerid, -1"{868A08}[Info]{AEB404} Bienvenue au San News : Intérieur RDC");
            }

            case 
8:
            {
            
SetPlayerPos(playerid351.2576,2845.3621,524.0903);
            
SendClientMessage(playerid, -1"{868A08}[Info]{AEB404} Bienvenue au San News : Intérieur 1ER ETAGE");
            }
        }
    }
    return 
1// 1163

XGreen is offline   Reply With Quote
Old 31/07/2020, 04:13 PM   #3
XGreen
Huge Clucker
 
XGreen's Avatar
 
Join Date: May 2014
Location: Manila
Posts: 207
Reputation: 8
Default Re: Errors

Some edits I've made from the reply. Sorry my bad. But it should work now.

PHP Code:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch(
dialogid)
    {
        case 
DIALOG_CONNECTION:
        {
            if(!
response) return Kick(playerid); 
            if(
strlen(inputtext) <= 5) return ShowPlayerDialog(playeridDIALOG_CONNECTIONDIALOG_STYLE_INPUT"Connexion""Veuillez saisir votre mot de passe :""Connexion""Quitter");
            
LoginCompte(playeridinputtext);
        }
        case 
DIALOG_REGISTER:
        {
            if(!
response) return Kick(playerid);
            if(
isnull(inputtext) || strlen(inputtext) <= 5) return ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_INPUT"Enregistrement""Pour t'inscrire entre un mot de passe d'au moins 5 caractères.""Enregistrer""Quitter");
            new 
ip[16], mdp[129];
            
GetPlayerIp(playeridipsizeof(ip));
               
GetPlayerName(playeridNomsizeof(Nom));
            
format(mdpsizeof(mdp), "%s"inputtext);
            
JoueurInfo[playerid][Mdp2] = mdp;
            
JoueurInfo[playerid][IP2] = ip;
            
mysql_format(mysqlreqsizeof(req), "INSERT INTO `membre` (Pseudo, Mdp2, score, Team, IP2, Argent, Admin) VALUES ('%e', '%e', %d, '%e', %d, %d, %d)"NomJoueurInfo[playerid][Mdp2], JoueurInfo[playerid][score], JoueurInfo[playerid][Team], JoueurInfo[playerid][IP2], JoueurInfo[playerid][Argent], JoueurInfo[playerid][Admin]);
            
mysql_tquery(mysqlreq"""");

            return 
ShowPlayerDialog(playeridDIALOG_CONNECTIONDIALOG_STYLE_INPUT"Connexion""Entre ton mot de passe :""Connexion""Quitter");
        }
        case 
123:
        {
            if(
response)
            {
                switch(
listitem)
                {
                    case 
0// LS
                    
{
                        
SetSpawnInfo(playerid1311,1580.1716,-1634.3556,13.5623,0,0,0,0,0,0,0);
                        
SetPlayerPos(playerid1580.1716,-1634.3556,13.5623);
                        
SetPlayerSkin(playerid311);
                        
SendClientMessage(playerid, -1"{08088A}[Info]{0101DF} Vous avez rejoint la team «LSPD»");
                         
SetPlayerHealth(playerid100.0);
                        
SetPlayerArmour(playerid100.0);
                        
SetPlayerMarkerForPlayer421, ( GetPlayerColor) | 0x00008BFF ) );
                        
SetPlayerColor(playerid0x00008BFF);
                        
GivePlayerWeapon(playerid2750);
                        
GivePlayerWeapon(playerid2415);
                        
GivePlayerWeapon(playerid175);
                        
TogglePlayerSpectating(playeridfalse);
                    }
                    case 
1// SF
                    
{
                        
SetSpawnInfo(playerid27,-1979.3777,137.7212,27.6875,0,0,0,0,0,0,0);
                        
SetPlayerPos(playerid, -1979.3777,137.7212,27.6875);
                        
SetPlayerSkin(playerid7);
                        
SendClientMessage(playerid, -1"{2E2E2E}[Info]{585858} Vous avez rejoint la team «Civil»");
                        
SetPlayerHealth(playerid100.0);
                        
SetPlayerArmour(playerid100.0);
                        
SetPlayerMarkerForPlayer421, ( GetPlayerColor) | 0xAFAFAFAA ) );
                        
SetPlayerColor(playerid0xAFAFAFAA);
                        
GivePlayerWeapon(playerid950);
                        
GivePlayerWeapon(playerid2215);
                        
GivePlayerWeapon(playerid3330);
                        
TogglePlayerSpectating(playeridfalse);
                    }
                    case 
2// BS
                    
{
                        
SetSpawnInfo(playerid3108,-2492.1594,2363.1672,10.2769,0,0,0,0,0,0,0);
                        
SetPlayerPos(playerid, -2492.1594,2363.1672,10.2769);
                        
SetPlayerSkin(playerid108);
                        
SendClientMessage(playerid, -1"{D7DF01}[Info]{FFFF00} Vous avez rejoint la team «Vagos»");
                        
SetPlayerHealth(playerid100.0);
                        
SetPlayerArmour(playerid100.0);
                        
SetPlayerMarkerForPlayer421, ( GetPlayerColor) | 0xFFFF00AA ) );
                        
SetPlayerColor(playerid0xFFFF00AA);
                        
GivePlayerWeapon(playerid3050);
                        
GivePlayerWeapon(playerid550);
                        
GivePlayerWeapon(playerid3250);
                        
TogglePlayerSpectating(playeridfalse);
                    }
                    case 
3// FC
                    
{
                        
SetSpawnInfo(playerid4167,184.9717,1167.7344,14.7578,0,0,0,0,0,0,0);
                        
SetPlayerPos(playerid184.9717,1167.7344,14.7578);
                        
SetPlayerSkin(playerid167);
                        
SendClientMessage(playerid, -1"{8A0808}[Info]{FF0000} Vous avez rejoint la team «Criminel»");
                        
SetPlayerHealth(playerid100.0);
                        
SetPlayerArmour(playerid100.0);
                        
SetPlayerMarkerForPlayer421, ( GetPlayerColor) | 0xBD0000FF ) );
                        
SetPlayerColor(playerid0xBD0000FF);
                        
GivePlayerWeapon(playerid3430);
                        
GivePlayerWeapon(playerid3050);
                        
GivePlayerWeapon(playerid185);
                        
TogglePlayerSpectating(playeridfalse);
                    }
                }
            }
            return 
1;
        }
        case 
45:
        {
            if(
response)
            {
                switch(
listitem)
                {
                    case 
0PlayAudioStreamForPlayer(playerid"http://cdn.nrjaudio.fm/audio1/fr/30001/mp3_128.mp3?origine=fluxradios");
                    case 
1PlayAudioStreamForPlayer(playerid"http://broadcast.infomaniak.ch/hitwest-high.mp3");
                    case 
2PlayAudioStreamForPlayer(playerid"http://streaming.radio.funradio.fr/fun-1-48-192");
                    case 
3PlayAudioStreamForPlayer(playerid"https://radiobonheur.ice.infomaniak.ch/radiobonheur-128-1.mp3");
                    case 
4PlayAudioStreamForPlayer(playerid"http://streaming.radio.rtl2.fr/rtl2-1-48-192");
                    case 
5PlayAudioStreamForPlayer(playerid"http://direct.franceinfo.fr/live/franceinfo-midfi.mp3");
                    case 
6PlayAudioStreamForPlayer(playerid"http://oceanefm.ice.infomaniak.ch/oceanefm-128.mp3");
                    case 
7StopAudioStreamForPlayer(playerid);
                }
            }
            return 
1;
         }
         case 
5:
        {
            if(
response)
            {
                switch(
listitem)
                {
                    case 
0ShowPlayerDialog(playerid5DIALOG_STYLE_MSGBOX"Aide » Véhicule""{FE9A2E}- {B43104}«/veh, /infernus»""Allez""Fermer");
                    case 
1ShowPlayerDialog(playerid5DIALOG_STYLE_MSGBOX"Aide » Skin""{FE9A2E}- {B43104}«/fille, /skin»""Allez""Fermer");
                    case 
2ShowPlayerDialog(playerid5DIALOG_STYLE_MSGBOX"Aide » Armes""{FE9A2E}- {B43104}«/eagle, /sniper»""Allez""Fermer");
                    case 
3ShowPlayerDialog(playerid5DIALOG_STYLE_MSGBOX"Aide » Divers""{FE9A2E}- {B43104}«/explosemoi, /fleurs»\n{FE9A2E}- {B43104}»/sirene, /police, /veh, /reclass»\n{FE9A2E}- {B43104}«/musique, /butiner, /suicider, /monter, /descendre, /debug, /detente, /op, /nos»""Allez""Fermer");
                }
            }
            return 
1;
         }
        case 
Mapping// ligne 1106
        
{
            if(
response)
            {
                switch(
listitem)
                {
                    case 
0:
                    {
                    
SetPlayerPos(playerid, -203.877842305.74927701.74390);
                    
SendClientMessage(playerid, -1"{868A08}[Info]{AEB404} Bienvenue dans le Bar/Tabac de Florentin");
                    }

                    case 
1:
                    {
                    
SetPlayerPos(playerid2519.5601, -1293.7400995.8500);
                    
SendClientMessage(playerid, -1"{868A08}[Info]{AEB404} Bienvenue dans l'ancienne base secrète WPS !");
                    }

                    case 
2:
                    {
                    
SetPlayerPos(playerid, -1633.9410,670.5158,-5.2399);
                    
SendClientMessage(playerid, -1"{868A08}[Info]{AEB404} Bienvenue au Stand de Tir de la SFPD");
                    }

                    case 
3:
                    {
                    
SetPlayerPos(playerid, -1806.37992.70444.9609);
                    
SendClientMessage(playerid, -1"{868A08}[Info]{AEB404} Bienvenue au quartier CRIPS");
                    }

                    case 
4:
                    {
                    
SetPlayerPos(playerid, -2127.2285,-64.5489,35.3203);
                    
SendClientMessage(playerid, -1"{868A08}[Info]{AEB404} Bienvenue au quartier BLOODS");
                    }

                    case 
5:
                    {
                    
SetPlayerPos(playerid, -2101.1367,56.6571,35.3203);
                    
SendClientMessage(playerid, -1"{868A08}[Info]{AEB404} Bienvenue au CyberCafé : Extérieur");
                    }

                    case 
6:
                    {
                    
SetPlayerPos(playerid, -383.0371,1502.3716,801.8282);
                    
SendClientMessage(playerid, -1"{868A08}[Info]{AEB404} Bienvenue au CyberCafé : Intérieur");
                    }

                    case 
7:
                    {
                    
SetPlayerPos(playerid374.2582,2840.0972,501.5304);
                    
SendClientMessage(playerid, -1"{868A08}[Info]{AEB404} Bienvenue au San News : Intérieur RDC");
                    }

                    case 
8:
                    {
                    
SetPlayerPos(playerid351.2576,2845.3621,524.0903);
                    
SendClientMessage(playerid, -1"{868A08}[Info]{AEB404} Bienvenue au San News : Intérieur 1ER ETAGE");
                    }
                }
            }
            return 
1// 1163
        
}
   return 
1// 1165
// 1666 
XGreen is offline   Reply With Quote
Old 31/07/2020, 04:34 PM   #4
Erwan
Big Clucker
 
Erwan's Avatar
 
Join Date: Jun 2013
Posts: 77
Reputation: 0
Default Re: Errors

I corrected what you said, but I still have this error

pawn Code:
C:\Users\touto\Desktop\serveur GTA\gamemodes\MagicsDM.pwn(993) : warning 217: loose indentation
C:\Users\touto\Desktop\serveur GTA\gamemodes\MagicsDM.pwn(994) : warning 217: loose indentation
C:\Users\touto\Desktop\serveur GTA\gamemodes\MagicsDM.pwn(1014) : warning 217: loose indentation
C:\Users\touto\Desktop\serveur GTA\gamemodes\MagicsDM.pwn(1015) : warning 217: loose indentation
C:\Users\touto\Desktop\serveur GTA\gamemodes\MagicsDM.pwn(1167) : error 002: only a single statement (or expression) can follow each "case"
C:\Users\touto\Desktop\serveur GTA\gamemodes\MagicsDM.pwn(1167) : warning 215: expression has no effect
C:\Users\touto\Desktop\serveur GTA\gamemodes\MagicsDM.pwn(1168) : warning 209: function "S@@_OnDialogResponse" should return a value
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
__________________
Erwan is offline   Reply With Quote
Old 31/07/2020, 04:37 PM   #5
XGreen
Huge Clucker
 
XGreen's Avatar
 
Join Date: May 2014
Location: Manila
Posts: 207
Reputation: 8
Default Re: Errors

Quote:
Originally Posted by Erwan View Post
I corrected what you said, but I still have this error

pawn Code:
C:\Users\touto\Desktop\serveur GTA\gamemodes\MagicsDM.pwn(993) : warning 217: loose indentation
C:\Users\touto\Desktop\serveur GTA\gamemodes\MagicsDM.pwn(994) : warning 217: loose indentation
C:\Users\touto\Desktop\serveur GTA\gamemodes\MagicsDM.pwn(1014) : warning 217: loose indentation
C:\Users\touto\Desktop\serveur GTA\gamemodes\MagicsDM.pwn(1015) : warning 217: loose indentation
C:\Users\touto\Desktop\serveur GTA\gamemodes\MagicsDM.pwn(1167) : error 002: only a single statement (or expression) can follow each "case"
C:\Users\touto\Desktop\serveur GTA\gamemodes\MagicsDM.pwn(1167) : warning 215: expression has no effect
C:\Users\touto\Desktop\serveur GTA\gamemodes\MagicsDM.pwn(1168) : warning 209: function "S@@_OnDialogResponse" should return a value
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Replace the OnDialogResponse with my latest reply.
XGreen is offline   Reply With Quote
Old 04/08/2020, 03:35 PM   #6
Erwan
Big Clucker
 
Erwan's Avatar
 
Join Date: Jun 2013
Posts: 77
Reputation: 0
Default Re: Errors

Quote:
Originally Posted by XGreen View Post
Replace the OnDialogResponse with my latest reply.



Yes that's what I did and it's exactly the same, the same mistakes as my last comment
__________________
Erwan is offline   Reply With Quote
Old 04/08/2020, 03:38 PM   #7
Proxus
Huge Clucker
 
Proxus's Avatar
 
Join Date: May 2018
Location: United Kingdom
Posts: 463
Reputation: 20
Default Re: Errors

OnDialogResponse should return 0 in its function (not the dialogs, the function itself), instead of 1.
__________________
Developer @ Trucknation
"Never tell people how to do things. Tell them what to do and they will surprise you with their ingenuity"


IMPORTANT LINKS
An upcoming mix of trucking & light roleplay
Proxus is offline   Reply With Quote
Old 04/08/2020, 03:42 PM   #8
Erwan
Big Clucker
 
Erwan's Avatar
 
Join Date: Jun 2013
Posts: 77
Reputation: 0
Default Re: Errors

Quote:
Originally Posted by Proxus View Post
OnDialogResponse should return 0 in its function (not the dialogs, the function itself), instead of 1.

Like this at the end of the coup code?

pawn Code:
}
                }
            }
            return 1;
        }
   return 0;
}
__________________
Erwan is offline   Reply With Quote
Old 04/08/2020, 03:59 PM   #9
Proxus
Huge Clucker
 
Proxus's Avatar
 
Join Date: May 2018
Location: United Kingdom
Posts: 463
Reputation: 20
Default Re: Errors

Quote:
Originally Posted by Erwan View Post
Like this at the end of the coup code?

pawn Code:
}
                }
            }
            return 1;
        }
   return 0;
}
Looks right. Fairly hard to see it without the context of the code above it (without skimming between the code showed earlier and this) but yeah, it should return 0 and the dialogs should return 1.
__________________
Developer @ Trucknation
"Never tell people how to do things. Tell them what to do and they will surprise you with their ingenuity"


IMPORTANT LINKS
An upcoming mix of trucking & light roleplay
Proxus is offline   Reply With Quote
Old 04/08/2020, 04:04 PM   #10
Erwan
Big Clucker
 
Erwan's Avatar
 
Join Date: Jun 2013
Posts: 77
Reputation: 0
Default Re: Errors

Quote:
Originally Posted by Proxus View Post
Looks right. Fairly hard to see it without the context of the code above it (without skimming between the code showed earlier and this) but yeah, it should return 0 and the dialogs should return 1.

Here is what I did, and the error remains the same: /

pawn Code:
case Mapping: // ligne 1106
        {
            if(response)
            {
                switch(listitem)
                {
                    case 0:
                    {
                    SetPlayerPos(playerid, -203.87784, 2305.74927, 701.74390);
                    SendClientMessage(playerid, -1, "{868A08}[Info]{AEB404} Bienvenue dans le Bar/Tabac de Florentin");
                    }

                    case 1:
                    {
                    SetPlayerPos(playerid, 2519.5601, -1293.7400, 995.8500);
                    SendClientMessage(playerid, -1, "{868A08}[Info]{AEB404} Bienvenue dans l'ancienne base secrète WPS !");
                    }

                    case 2:
                    {
                    SetPlayerPos(playerid, -1633.9410,670.5158,-5.2399);
                    SendClientMessage(playerid, -1, "{868A08}[Info]{AEB404} Bienvenue au Stand de Tir de la SFPD");
                    }

                    case 3:
                    {
                    SetPlayerPos(playerid, -1806.3799, 2.7044, 4.9609);
                    SendClientMessage(playerid, -1, "{868A08}[Info]{AEB404} Bienvenue au quartier CRIPS");
                    }

                    case 4:
                    {
                    SetPlayerPos(playerid, -2127.2285,-64.5489,35.3203);
                    SendClientMessage(playerid, -1, "{868A08}[Info]{AEB404} Bienvenue au quartier BLOODS");
                    }

                    case 5:
                    {
                    SetPlayerPos(playerid, -2101.1367,56.6571,35.3203);
                    SendClientMessage(playerid, -1, "{868A08}[Info]{AEB404} Bienvenue au CyberCafé : Extérieur");
                    }

                    case 6:
                    {
                    SetPlayerPos(playerid, -383.0371,1502.3716,801.8282);
                    SendClientMessage(playerid, -1, "{868A08}[Info]{AEB404} Bienvenue au CyberCafé : Intérieur");
                    }

                    case 7:
                    {
                    SetPlayerPos(playerid, 374.2582,2840.0972,501.5304);
                    SendClientMessage(playerid, -1, "{868A08}[Info]{AEB404} Bienvenue au San News : Intérieur RDC");
                    }

                    case 8:
                    {
                    SetPlayerPos(playerid, 351.2576,2845.3621,524.0903);
                    SendClientMessage(playerid, -1, "{868A08}[Info]{AEB404} Bienvenue au San News : Intérieur 1ER ETAGE");
                    }
                }
            }
            return 1;
        }
   return 0;
}
__________________
Erwan is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pawn Compiling errors, Errors and Line are inside [ +REP ] EgyptForLife Scripting Help 8 19/07/2014 08:26 PM
[S-HELP] Compiling errors, Errors and Lines inside. EgyptForLife Scripting Help 3 16/07/2014 07:56 PM
Class Errors: loose indentation (2 Errors) DerickClark Scripting Help 18 22/02/2014 08:01 PM
[ERRORS] Errors appear after adding a Gang System. ••• ĤÁĶÁM ••• Help Archive 17 27/10/2010 05:19 PM
Common compiling errors - READ BEFORE POSTING ERRORS Streetplaya Help Archive 0 23/01/2010 11:20 AM


All times are GMT. The time now is 07:17 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.