SA-MP Forums Archive
[HELP] Check Point -FAIL- - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Check Point -FAIL- (/showthread.php?tid=195781)



[HELP] Check Point -FAIL- - Larsey123IsMe - 03.12.2010

Few ERROR's =/

pawn Код:
#define COLOR_GREEN 0x33AA33AA
pawn Код:
new ArmourCP;
pawn Код:
public OnPlayerSpawn(playerid)
{
    ArmourCP = SetPlayerCheckpoint(playerid, 1982.6150, -220.6680, -0.2432, 3.0);
    return 1;
}
pawn Код:
public OnPlayerEnterCheckpoint(playerid, incheckpoint)
{
    if( incheckpoint == ArmourCP);
    {
        if (strcmp("/buyarmour", cmdtext, true, 10) == 0)
        {
        if(GetPlayerMoney(playerid) <= 5000)
        {
            SendClientMessage(playerid, COLOR_GREEN, "Armour Bought For 5000$");
            GivePlayerMoney(playerid, -5000);
            SetPlayerArmour(playerid, 100);
        }
        else
        {
        SendClientMessage(playerid, COLOR_GREEN, "You Dont Have 5000$");
        }
        return 1;
    }
    return 0;
}
ERROR:
pawn Код:
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\BuyThings.pwn(15) : error 025: function heading differs from prototype
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\BuyThings.pwn(17) : error 036: empty statement
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\BuyThings.pwn(19) : error 017: undefined symbol "cmdtext"
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\BuyThings.pwn(33) : warning 217: loose indentation
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\BuyThings.pwn(35) : error 030: compound statement not closed at the end of file (started at line 17)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.



Re: [HELP] Check Point -FAIL- - dice7 - 03.12.2010

You need to write the command under OnPlayerCommandText


Re: [HELP] Check Point -FAIL- - Larsey123IsMe - 03.12.2010

Still got ERROR's

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[], incheckpoint)
{
    if( incheckpoint == ArmourCP);
    {
        if (strcmp("/buyarmour", cmdtext, true, 10) == 0)
        {
            if(GetPlayerMoney(playerid) <= 5000)
            {
                SendClientMessage(playerid, COLOR_GREEN, "Armour Bought For 5000$");
                GivePlayerMoney(playerid, -5000);
                SetPlayerArmour(playerid, 100);
            }
            else
        {
        SendClientMessage(playerid, COLOR_GREEN, "You Dont Have 5000$");
        }
        return 1;
    }
}
ERROR:
pawn Код:
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\BuyThings.pwn(15) : error 025: function heading differs from prototype
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\BuyThings.pwn(17) : error 036: empty statement
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\BuyThings.pwn(31) : warning 217: loose indentation
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\BuyThings.pwn(34) : error 030: compound statement not closed at the end of file (started at line 17)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.



Re: [HELP] Check Point -FAIL- - dice7 - 03.12.2010

Why did you put 'incheckpoint' in the fucntion header ?


Re: [HELP] Check Point -FAIL- - Larsey123IsMe - 03.12.2010

1 ERRPR left:
pawn Код:
#define COLOR_GREEN 0x33AA33AA
//-------------------------------------------------------------------------------------------------------------
new ArmourCP;
//-------------------------------------------------------------------------------------------------------------
public OnPlayerSpawn(playerid)
{
    ArmourCP = SetPlayerCheckpoint(playerid, 1982.6150, -220.6680, -0.2432, 3.0);
    return 1;
}
//-------------------------------------------------------------------------------------------------------------
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(ArmourCP); //ERROR here =/
    {
        if (strcmp("/buyarmour", cmdtext, true, 10) == 0)
        {
            if(GetPlayerMoney(playerid) <= 5000)
            {
                SendClientMessage(playerid, COLOR_GREEN, "Armour Bought For 5000$");
                GivePlayerMoney(playerid, -5000);
                SetPlayerArmour(playerid, 100);
            }
            else
        {
        SendClientMessage(playerid, COLOR_GREEN, "You Dont Have 5000$");
        }
     }
   }
}
ERROR:
pawn Код:
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\BuyThings.pwn(17) : error 036: empty statement
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.



Re: [HELP] Check Point -FAIL- - Fresh-Gta - 03.12.2010

try this code
pawn Код:
#define COLOR_GREEN 0x33AA33AA
//-------------------------------------------------------------------------------------------------------------
new ArmourCP;
//-------------------------------------------------------------------------------------------------------------
public OnPlayerSpawn(playerid)
{
    ArmourCP = SetPlayerCheckpoint(playerid, 1982.6150, -220.6680, -0.2432, 3.0);
    return 1;
}
//-------------------------------------------------------------------------------------------------------------
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (IsPlayerInRangeOfPoint( playerid, 5, 1982.6150, -220.6680, -0.2432))
    {
        if (strcmp("/buyarmour", cmdtext, true, 10) == 0)
        {
            if(GetPlayerMoney(playerid) <= 5000)
            {
                SendClientMessage(playerid, COLOR_GREEN, "Armour Bought For 5000$");
                GivePlayerMoney(playerid, -5000);
                SetPlayerArmour(playerid, 100);
            }
            else
        {
        SendClientMessage(playerid, COLOR_GREEN, "You Dont Have 5000$");
        }
     }
   }
}



Re: [HELP] Check Point -FAIL- - Larsey123IsMe - 03.12.2010

Thanks, But when i have $50.000... then type /buyarmour (OFC in ckeckpoint) then it says "You Dont Have 5000$" :S?

And... on mini map it is a "red dot" who leads me to the Check point, how can i delete that dot?