SA-MP Forums Archive
[HELP] CreateDynamicCP - 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: [HELP] CreateDynamicCP (/showthread.php?tid=411692)



[HELP] CreateDynamicCP - California_ - 30.01.2013

Okay I Know CreateDynamicCP is like this

pawn Код:
native CreateDynamicCP(Float:x, Float:y, Float:z, Float:size, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 100.0);
But How do I make it where it teleports you to somewhere Like i created a Checkpoint but where can I make it do somthing to the player like, GivePlayerMoney, SetPlayerPos


Re: [HELP] CreateDynamicCP - Threshold - 30.01.2013

pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    if(checkpointid == mycheckpoint1)
    {
        SetPlayerPos(playerid, x, y, z);
    }
    if(checkpointid == mycheckpoint2)
    {
        GivePlayerMoney(playerid, 1000);
    }
    return 1;
}
This is an example of how you might use it. Read the streamer plugin for information on callbacks and functions included in the streamer plugin itself. https://sampforum.blast.hk/showthread.php?tid=102865

The function you are requesting is called OnPlayerEnterDynamicCP which is called whenever a player enters a dynamic checkpoint that has been created on the server.


Re: [HELP] CreateDynamicCP - MA_proking - 30.01.2013

pawn Код:
public OnPlayerEnterDynamicCP(playerid,checkpointid)
{
        if(checkpointid == YourCPId)
        {
                GivePlayerMoney(playerid,Money);
                SetPlayerPos(playerid,Float:x,Float:y,Float:z);
                SendClientMessage(playerid,GREEN,"You have recieved  $Money");
        }
        return 1;
}