[HELP] I cant fix that error!! :(
#1

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_SECONDARY_ATTACK)
    {

    if (PlayerToPoint(0.5, playerid, -2038.6663,-87.8214,35.3203))
    {
            SetPlayerPos(playerid, -2038.6670,-87.1617,35.4203);
            return 1;
        }
    SendClientMessage(playerid, 0x804040FF, "You're not near any door !");
    return 1;
        }

    if (PlayerToPoint(1, playerid, -2038.7289,-86.5928,35.4203))
    {
            SetPlayerPos(playerid, -2038.5620,-88.3436,35.3203);
            return 1;
        }
    SendClientMessage(playerid, 0x804040FF, "You're not near any door !");
    return 1;
        }
    return 1; // <-------------- line 249
    }
After compile:
pawn Код:
C:\Documents and Settings\xxxxxxx\Desktop\Desktop\server\gamemodes\gmtest.pwn(249) : error 010: invalid function or declaration
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#2

Which line does it occur
Reply
#3

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_SECONDARY_ATTACK)
{
if (PlayerToPoint(0.5, playerid, -2038.6663,-87.8214,35.3203))
{
SetPlayerPos(playerid, -2038.6670,-87.1617,35.4203);
}else SendClientMessage(playerid, 0x804040FF, "You're not near any door !");

if (PlayerToPoint(1, playerid, -2038.7289,-86.5928,35.4203))
{
SetPlayerPos(playerid, -2038.5620,-88.3436,35.3203);
}elseSendClientMessage(playerid, 0x804040FF, "You're not near any door !");
}
return 1;
}
Is good?
Reply
#4

Quote:
Originally Posted by Swift_
Which line does it occur
Scroll down the code little bit -.-'


When you scroll down:
pawn Код:
if (PlayerToPoint(1, playerid, -2038.7289,-86.5928,35.4203))
    {
            SetPlayerPos(playerid, -2038.5620,-88.3436,35.3203);
            return 1;
        }
    SendClientMessage(playerid, 0x804040FF, "You're not near any door !");
    return 1;
        }
    return 1; // <-------------- line 249
    }
Reply
#5

You give that error because you put too many "return 1".
Put this:
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_SECONDARY_ATTACK)
{
if (PlayerToPoint(0.5, playerid, -2038.6663,-87.8214,35.3203)) return SetPlayerPos(playerid, -2038.6670,-87.1617,35.4203);
else SendClientMessage(playerid, 0x804040FF, "You're not near any door !");

if (PlayerToPoint(1, playerid, -2038.7289,-86.5928,35.4203)) return SetPlayerPos(playerid, -2038.5620,-88.3436,35.3203);
else SendClientMessage(playerid, 0x804040FF, "You're not near any door !");
}
return 1;
}
Reply
#6

Thanks dude it works
Reply
#7

Код:
return 0;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)