SA-MP Forums Archive
Dynamic CP's - 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)
+--- Thread: Dynamic CP's (/showthread.php?tid=361900)



Dynamic CP's [ERROR] - Dan. - 22.07.2012

How to detect if a player enters dynamic CP (streamer plugin)?

I tried this:
Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid);
{
	return 1;
}
But it's giving me errors.


Re: Dynamic CP's - ReneG - 22.07.2012

You're doing it wrong somewhere.

Post what the compiler said.


Re: Dynamic CP's - Dan. - 22.07.2012

pawn Код:
error 055: start of function body without function header
error 010: invalid function or declaration
Made the error lines bold on first post.


Re: Dynamic CP's - Cypress - 22.07.2012

remove the ; from public OnPlayerEnterDynamicCP(playerid, checkpointid);


pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    return 1;
}



Re: Dynamic CP's - Dan. - 22.07.2012

Aww, I am so dumb. How could I have missed that.. thanks!


Re: Dynamic CP's - Dan. - 22.07.2012

ERROR:

pawn Код:
error 008: must be a constant expression; assumed zero
This is the code:
pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    switch(checkpointid)
    {
        case A51CP: // The error line
        {
            SendClientMessage(playerid, C_GREY, "Works!");
        }
    }
   
    return 1;
}



Re: Dynamic CP's - TheArcher - 22.07.2012

pawn Код:
#define A51CP (0) // A51CP has the ID 0
So its like doing case: 0