Again... need help with dialogresponse.
#1

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 0)
    {
        if(response)
        {
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                new Float:pHealth;
                SendClientMessageToAll(0xFFFFFF, "An anthrax bomb has been deployed in whole san andreas!");
                if(IsPlayerInArea(i, -2988.28125, -3011.71875, 3070.3125, 3000))
                    {
                    GetPlayerHealth(i, pHealth);
                    SetPlayerHealth(i, -75);
                    ApplyAnimation(i,"CRACK","crckidle2",1,0,0, 0,0,0);
                    }
                if (pHealth < 0)
                    {
                        SendDeathMessage(playerid, i, 41);
                    }
                SetWeather(20);
                SetTimer("ChangeWeather",30000,true);
                }
                /*else*/
                {
                    SendClientMessage(playerid, 0xFF0000, "You canceled!");
                }
               
            }
        }
   }
Error in the line 57: marked with /* */ if anyone could fix this problem for me i would be very grateful.

Error:
pawn Код:
C:\Users\Guille\Desktop\Samp scripting\Server23\server12\gamemodes\FS_Anthrax.pwn(57) : error 029: invalid expression, assumed zero
Reply
#2

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 0)
	{
        if(response)
        {
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                new Float:pHealth;
                SendClientMessageToAll(0xFFFFFF, "An anthrax bomb has been deployed in whole san andreas!");
                if(IsPlayerInArea(i, -2988.28125, -3011.71875, 3070.3125, 3000))
                {
                    	GetPlayerHealth(i, pHealth);
                    	SetPlayerHealth(i, -75);
                    	ApplyAnimation(i,"CRACK","crckidle2",1,0,0, 0,0,0);
                }
                if (pHealth < 0)
                {
                        SendDeathMessage(playerid, i, 41);
                }
                SetWeather(20);
                SetTimer("ChangeWeather",30000,true);
            }
        }
       	else
        {
            	SendClientMessage(playerid, 0xFF0000, "You canceled!");
        }
	}
	return 1;
}
Hop this solves ur problem.
Reply
#3

Proper indentation is extremely important in programming. I hope you see why now.
Reply
#4

If you do not want to encounter error like this in future then add
pawn Код:
#pragma tabsize 0
at top of your script below the include's.
Reply
#5

Quote:
Originally Posted by [MM]RoXoR[FS]
Посмотреть сообщение
If you do not want to encounter error like this in future then add
pawn Код:
#pragma tabsize 0
at top of your script below the include's.


You're supposed to teach n00bies the RIGHT way to do things. You're totally misusing that ability.
Reply
#6

Noted that, thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)