SA-MP Forums Archive
Help me with creating pickups - 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 me with creating pickups (/showthread.php?tid=509875)



Help me with creating pickups - saikumar - 28.04.2014

hiii guys,
i want to create a pickup i.e Red mark like in SP used for missions.
and if the player enters into that red mark he should be teleported to an interior that i want.
can guys help me by explaining how to do that

thanks in Advance!!!


Re: Help me with creating pickups - Crypto20 - 28.04.2014

You would use this https://sampwiki.blast.hk/wiki/OnPlayerEnterCheckpoint
for example of use:
Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerCheckpoint(playerid, 1982.6150, -220.6680, -0.2432, 3.0);
    return 1;
}
 
public OnPlayerEnterCheckpoint(playerid)
{
    SetPlayerPos(playerid,1982.6150, -220.6680, -0.2432);//change pos to what ever your interior position
    SetPlayerVirtualWorld(playerid, 69);// You would change the virtual world to your interior vw.
    DisablePlayerCheckpoint(playerid);
    return 1;
}



Re: Help me with creating pickups - saikumar - 28.04.2014

Quote:
Originally Posted by Crypto20
Посмотреть сообщение
You would use this https://sampwiki.blast.hk/wiki/OnPlayerEnterCheckpoint
for example of use:
Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerCheckpoint(playerid, 1982.6150, -220.6680, -0.2432, 3.0);
    return 1;
}
 
public OnPlayerEnterCheckpoint(playerid)
{
    SetPlayerPos(playerid,1982.6150, -220.6680, -0.2432);//change pos to what ever your interior position
    SetPlayerVirtualWorld(playerid, 69);// You would change the virtual world to your interior vw.
    DisablePlayerCheckpoint(playerid);
    return 1;
}
and what is the use of DisablePlayerCheckpoint(playerid);


Re: Help me with creating pickups - Brandon_More - 28.04.2014

Quote:
Originally Posted by saikumar
Посмотреть сообщение
and what is the use of DisablePlayerCheckpoint(playerid);
https://sampwiki.blast.hk/wiki/DisablePlayerCheckpoint


Re: Help me with creating pickups - saikumar - 28.04.2014

Quote:
Originally Posted by Brandon_More
Посмотреть сообщение
can anybody give me a clear explanation ??


AW: Help me with creating pickups - Macronix - 28.04.2014

DisablePlayerCheckpoint would just destroy the checkpoint you entered


Re: AW: Help me with creating pickups - saikumar - 28.04.2014

Quote:
Originally Posted by Macronix
Посмотреть сообщение
DisablePlayerCheckpoint would just destroy the checkpoint you entered
destroy temp or permanently?


Re: Help me with creating pickups - saikumar - 28.04.2014

Quote:
Originally Posted by Crypto20
Посмотреть сообщение
You would use this https://sampwiki.blast.hk/wiki/OnPlayerEnterCheckpoint
for example of use:
Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerCheckpoint(playerid, 1982.6150, -220.6680, -0.2432, 3.0);
    return 1;
}
 
public OnPlayerEnterCheckpoint(playerid)
{
    SetPlayerPos(playerid,1982.6150, -220.6680, -0.2432);//change pos to what ever your interior position
    SetPlayerVirtualWorld(playerid, 69);// You would change the virtual world to your interior vw.
    DisablePlayerCheckpoint(playerid);
    return 1;
}
sorry for double post.

i want create several checkpoints not only one...
how to do that with this script?


Re: Help me with creating pickups - Konstantinos - 28.04.2014

By using a streamer: https://sampforum.blast.hk/showthread.php?tid=102865

pawn Код:
// functions:
native CreateDynamicCP(Float:x, Float:y, Float:z, Float:size, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 100.0);
native DestroyDynamicCP(checkpointid);
native IsValidDynamicCP(checkpointid);
native TogglePlayerDynamicCP(playerid, checkpointid, toggle);
native TogglePlayerAllDynamicCPs(playerid, toggle);
native IsPlayerInDynamicCP(playerid, checkpointid);
native GetPlayerVisibleDynamicCP(playerid);
and
pawn Код:
// callbacks:
forward OnPlayerEnterDynamicCP(playerid, checkpointid);
forward OnPlayerLeaveDynamicCP(playerid, checkpointid);



Re: Help me with creating pickups - saikumar - 28.04.2014

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
By using a streamer: https://sampforum.blast.hk/showthread.php?tid=102865

pawn Код:
// functions:
native CreateDynamicCP(Float:x, Float:y, Float:z, Float:size, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 100.0);
native DestroyDynamicCP(checkpointid);
native IsValidDynamicCP(checkpointid);
native TogglePlayerDynamicCP(playerid, checkpointid, toggle);
native TogglePlayerAllDynamicCPs(playerid, toggle);
native IsPlayerInDynamicCP(playerid, checkpointid);
native GetPlayerVisibleDynamicCP(playerid);
and
pawn Код:
// callbacks:
forward OnPlayerEnterDynamicCP(playerid, checkpointid);
forward OnPlayerLeaveDynamicCP(playerid, checkpointid);
can u please show me a clear example with
creating a dynamic CP for teleports please
im a noob scripter
please