warning 209: function "OnDialogResponse" should return a value
#1

HYE I EDIT THE FS BUT NOT WORK

Code:

Quote:

/*
================================================== =
=================High Jump fS======================
================================================== =
| |
Created By: Zayan

Created On: 13/02/2013 [20:34:21]

Created By Using: Pawn compiler 3.2.3664 (PAWNO)

Thanks To: SA-MP for functions & more

If you find any bug, please report it with a photo.

*/
#include <a_samp>
#include <streamer>
#define COLOR_RED 0xFF0000FF

#define INFINITY \
(Float:0x7F800000) // this define was added in V-0.3 | Comment added in (V-0.3)

new
IsMad[MAX_PLAYERS]; // Dont edit or remove it | Comment added in (V-0.2)

new
Float:ghp; // This line is for ythe

new
Float:health;

public OnFilterScriptInit()
{
print("\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~");
print(" High Jump Filter Script by Zayan \nIf you find any bug, please report on www.sa-mp.com");
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~\n");





CreateDynamicCP(914.2001,2006.7981,10.8203, 1.0);

return 1;
}

public OnFilterScriptExit()
{
return 1;
}
public OnPlayerConnect(playerid)
{
IsMad[playerid] = 0; // This was very important, added in V-0.3 | Comment was added in (V-0.3)
ShowInfo(playerid);
return 1;
}


public OnPlayerEnterCheckpoint(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 1.0, 914.2001,2006.7981,10.8203))
{
if(IsMad[playerid] == 0)
{
ShowPlayerDialog(playerid, 2512, DIALOG_STYLE_LIST, " Mega Jump", "{FF0000}Mega Jump={00FF33} On $500000$\n", "Buy", "Cancle");
SetPlayerHealth(playerid, INFINITY); // This function was added in V-0.3 | Comment added in (V-0.3)
return 1;
}
else if(IsMad[playerid] == 1)
{
ShowPlayerDialog(playerid, 2512, DIALOG_STYLE_LIST, " Mega Jump", "{FF0000}Mega Jump={00FF33} Off $500000$$\n", "Buy", "Cancle");
IsMad[playerid] = 0;
SetPlayerHealth(playerid, 100); // This line was added in V-0.3 | Comment was added in (V-0.3)
return 1;
}
return 1;
}
return 0;
}




public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_JUMP) // you can change KEY_JUMP to any key name e.g: KEY_FIRE (left mouse button) | KEY_SPRINT (space key) & more | Comment added in (V-0.2)
{
if(IsMad[playerid] == 1)
{
new Float:X;
new Float:Y;
new Float:Z;
GetPlayerPos(playerid, X,Y,Z);
GetPlayerHealth(playerid, ghp);
CreateExplosion(X,Y,Z-2,7,6);
SetPlayerHealth(playerid, ghp);
SetPlayerHealth(playerid, INFINITY);
}
}
return 1;
}
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
if(playerid != INVALID_PLAYER_ID)
{
if(IsMad[playerid] == 1)
{
SetPlayerHealth(playerid, INFINITY);
GetPlayerHealth(playerid,health);
if ( health < 19.9 ) // This line was added in V-0.3 | This was added for a health bug fix | Comment was added in (V-0.3)
{
SetPlayerHealth(playerid, INFINITY);
}
}
}
return 1;
}
stock ShowInfo(playerid) // dont remove it ;C | Comment added in (V-0.2)
{
GameTextForPlayer(playerid, "This server is running~n~High jump fs by zayan", 7000, 4);
}
stock ReturnErrMsg(playerid) // new function added in (V-0.2) * it returns a error message of "You are not a RCON admin!" | e.g: if(!IsPlayerAdmin(playerid)) return ReturnErrMsg(playerid) | Comment added in (V-0.2)
{
return SendClientMessage(playerid, 0xFFBBAA, "You are not a RCON admin!");
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 2512)
{
if(response)
{
if(listitem == 0)
{
if(GetPlayerMoney(playerid) < 500000) return SendClientMessage(playerid, COLOR_RED, "[ERROR]{FFFFFF}You Must Have 500000$ To Buy This Item");
if(IsMad[playerid] == 0)
return 1;
}
if(listitem == 1)
{
if(GetPlayerMoney(playerid) < 500000) return SendClientMessage(playerid, COLOR_RED, "[ERROR]{FFFFFF}You Must Have 500000$ To Buy This Item");
if(IsMad[playerid] == 1)
return 1;
}
return 1;
}
}
}

HELP ME
Reply
#2

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 2512)
	{
		if(response)
		{
			if(listitem == 0)
			{
				if(GetPlayerMoney(playerid) < 500000) return SendClientMessage(playerid, COLOR_RED, "[ERROR]{FFFFFF}You Must Have 500000$ To Buy This Item");
				if(IsMad[playerid] == 0)
				return 1;
				}
			if(listitem == 1)
			{
				if(GetPlayerMoney(playerid) < 500000) return SendClientMessage(playerid, COLOR_RED, "[ERROR]{FFFFFF}You Must Have 500000$ To Buy This Item");
				if(IsMad[playerid] == 1)
				return 1;
			}
			return 1;
		}
	}
	return 1;
}
Next time use [code]


You need to place
Код:
return 1;
before the last closing bracket.
Reply
#3

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 2512)
    {
        if(response)
        {
            if(listitem == 0)
            {
                if(GetPlayerMoney(playerid) < 500000) return SendClientMessage(playerid, COLOR_RED, "[ERROR]{FFFFFF}You Must Have 500000$ To Buy This Item");
                if(IsMad[playerid] == 0)
                return 1;
            }
            if(listitem == 1)
            {
                if(GetPlayerMoney(playerid) < 500000) return SendClientMessage(playerid, COLOR_RED, "[ERROR]{FFFFFF}You Must Have 500000$ To Buy This Item");
                if(IsMad[playerid] == 1)
                return 1;
            }
            return 1;
        }
    }
    return 1;
}
Plus this code will not work..
Reply
#4

ok tnx
Reply
#5

You're telling me you can't READ the error and know what it means? It is pretty self-explanatory.
Reply
#6

Quote:
Originally Posted by MP2
Посмотреть сообщение
You're telling me you can't READ the error and know what it means? It is pretty self-explanatory.
True


also whats with HYE I EDIT THE FS BUT NOT WORK
Reply
#7

Gracias #Squirrel
solucione mi problema
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)