Pequeсo error
#1

Hola estuve haciendo un pequeсa funciуn para un juego estilo DM pero me salio un pequeсo error. no se si estan mal cerradas las llaves e.e

me sale este error

PHP код:
C:\Users\User\Desktop\Atakers.pwn(66) : warning 217loose indentation
C
:\Users\User\Desktop\Atakers.pwn(73) : error 002only a single statement (or expressioncan follow each "case"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
1 Error


Aqui el call

PHP код:
#include <a_samp>
#include <streamer>
#define FILTERSCRIPT
#define batalla 4
#define VERDELIMA           0xB1FF07FF
new string2[256];
#if defined FILTERSCRIPT
public OnPlayerCommandText(playeridcmdtext[])
{
    if(!
strcmp(cmdtext"/ad"true))
    {
         
ShowPlayerDialog(playeridbatallaDIALOG_STYLE_LIST"Atakers vs Defensores""Atakers\n Defensores\n""Seleccionar""Cancelar");
         return 
1;
    }
    return 
0
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch(
dialogid)
    {
        
//--
        
case batalla:
        {
            if(
response)
            {
                switch(
listitem)
                {
                
                
                    case 
0:
                    {
                        
SetPlayerArmour(playerid,100); //le da 100 de Chaleco
                        
SetPlayerHealth(playerid,100); //le da 100 de Vida
                        
SetPlayerPos(playerid,-799.2450,493.0715,1367.2328);
                        
GivePlayerWeapon(playerid249999);
                        
GivePlayerWeapon(playerid259999);
                        
GivePlayerWeapon(playerid349999);
                    }
                    
                    
                    case 
1
                    {
                        
SetPlayerArmour(playerid,100); //le da 100 de Chaleco
                        
SetPlayerHealth(playerid,100); //le da 100 de Vida
                        
SetPlayerPos(playerid,-759.2450,493.0715,1367.2328);
                        
GivePlayerWeapon(playerid249999);
                        
GivePlayerWeapon(playerid259999);
                        
GivePlayerWeapon(playerid349999);
                    }
                    
                }
            }
            else
            {
             }
                 return 
1;
            }
     
#endif 
realmente no se donde me equivoque
Reply
#2

Код:
#include <a_samp>
#include <streamer>

#define FILTERSCRIPT
#define batalla 4
#define VERDELIMA           0xB1FF07FF

#pragma tabsize 0
#if defined FILTERSCRIPT

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/ad", true))
    {
         ShowPlayerDialog(playerid, batalla, DIALOG_STYLE_LIST, "Atakers vs Defensores", "Atakers\n Defensores\n", "Seleccionar", "Cancelar");
         return 1;
    }
    return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == batalla)
	{
		if(response)
		{
			if(listitem == 0)
			{
				SetPlayerArmour(playerid,100); //le da 100 de Chaleco
				SetPlayerHealth(playerid,100); //le da 100 de Vida
				SetPlayerPos(playerid,-799.2450,493.0715,1367.2328);
				GivePlayerWeapon(playerid, 24, 9999);
				GivePlayerWeapon(playerid, 25, 9999);
				GivePlayerWeapon(playerid, 34, 9999);
			}
		}
			if(listitem == 1)
			{
				SetPlayerArmour(playerid,100); //le da 100 de Chaleco
				SetPlayerHealth(playerid,100); //le da 100 de Vida
				SetPlayerPos(playerid,-759.2450,493.0715,1367.2328);
				GivePlayerWeapon(playerid, 24, 9999);
				GivePlayerWeapon(playerid, 25, 9999);
				GivePlayerWeapon(playerid, 34, 9999);
			}
		}
	return 1;
}

#endif
Para que pusiste el string? te lo saque y saque el warning poniendo pragma
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)