[HELP] CreateDynamicCP
#1

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
Reply
#2

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.
Reply
#3

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)