Checkpoint [Help]
#1

Hello!
Can anyone help me with the checkpoint i know little bit of script,
i need someone to help me to create checkpoint for my server cops and robbers
and with streamer because the one without streamer doesn't help so please can anyone help and i will do rep +,
[Please With an Example because i'm little bit dump to understand].
Thanks,
Reply
#2

Код:
CreateDynamicCP(Float:x, Float:y, Float:z, Float:size, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_CP_SD, STREAMER_TAG_AREA areaid = STREAMER_TAG_AREA -1, priority = 0);
Example:
Код:
CMD:checkpoint(playerid, params[])
    return CreateDynamicCP(0.0, 0.0, 0.3, 3.0, -1, -1, playerid);
this will create a checkpoint in the middle of San Andreas (Blueberry Acres) for the player that uses this command. I think you should have ******d a bit before creating a thread.
Reply
#3

I already say that i'm dump and IDK how to script but i script an checkpoint without streamer and i want to add lot of CP's For my CNR game mode

Код:
#include <streamer>

public OnPlayerSpawn(playerid)
{
	SetPlayerCheckpoint(playerid, 3061.5154,-697.4962,2.8086, 5.0);
	return 1;
}

    public OnPlayerEnterCheckpoint(playerid)
{
	SetPlayerPos(playerid, 3048.9915,-672.5724,2.8086);
	return 1;
}
Can you help to add interiors and something like that , you played CNR ? Don't ya ?
Reply
#4

For what your trying to do here, you need to name and shame your checkpoints.

Example:
Global Definition is KEY!
pawn Код:
#define MAX_ENTEREXIT 20
new EnterExitCheckpoints[MAX_ENTEREXIT];
Note above that I'm keeping the groups small this helps a lot when you get to increase the size of your server.

You can even do this singly:
pawn Код:
new PoliceLSEnter;
pawn Код:
OnGameModeInit()
{
     EnterExitCheckpoints[0] = CreateDynamicCP(0.0, 0.0, 0.3, 3.0, -1, -1, playerid);
     EnterExitCheckpoints[1] = CreateDynamicCP(0.0, 0.0, 0.3, 3.0, -1, -1, playerid);
     PoliceLSEnter = CreateDynamicCP(0.0, 0.0, 0.3, 3.0, -1, -1, playerid);
     return 1;
}
Here we are telling the server which checkpoint is which is at what location and what identifying array we are assigning it to.

Use these to check?

pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
        if(checkpointid == EnterExitCheckpoints[0]) return SetPlayerPos();
        if(checkpointid == EnterExitCheckpoints[1]) return SetPlayerPos();
        if(checkpointid == PoliceLSEnter) return SetPlayerPos();
    return 1;
}
Checking which checkpoint the player is in and then acting upon this here we check is he is in the checkpoints 0, and 1. If he is set his position to wherever.

I also recommended using Incognitos Streamer too, ad you'll soon drive your server towards a brick wall using the standard checkpoint system.

Also note above I am returning when we find the checkpoint the player is in, I personally recommend you ALWAYS return as players can only be in one checkpoint at once... unless you've made a bo bo. In which case he will trigger one first. This saves server time checking things which you already know aren't possible.
Reply
#5

I can't wait to test this Thanks dude this One will help too much i will do rep for you this script is looking too simple for me thanks dude. <3
Reply
#6

Quote:
Originally Posted by Ihabou
Посмотреть сообщение
I can't wait to test this Thanks dude this One will help too much i will do rep for you this script is looking too simple for me thanks dude. <3
No problem, if you need any help just post up your code and we'll help again.
Reply
#7

Quote:
Originally Posted by IceCube!
Посмотреть сообщение
pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
        if(checkpointid == EnterExitCheckpoints[0]) return SetPlayerPos();
        if(checkpointid == EnterExitCheckpoints[1]) return SetPlayerPos();
        if(checkpointid == PoliceLSEnter) return SetPlayerPos();
    return 1;
}
https://sampwiki.blast.hk/wiki/Control_Structures#switch_2
Reply
#8

Quote:
Originally Posted by GoldenLion
Посмотреть сообщение
Also a good idea as you can break the switch statement, I never said however not to use it I'd just forgotten about it. I haven't programmed anything in a few years. Just getting back upto speed, I even had to ****** Incognitos Streamer to remember the call back.
Reply
#9

Код:
#include <streamer>

new Checkpoint [MAX_PLAYERS];

public OnPlayerSpawn(playerid)

Checkpoint[0] = CreateDynamicCP(1402.6344,-1697.8345,13.5533, 2, -1, -1, -1, 100);

public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
   if(checkpointid == Checkpoint[0])
   {
   SetPlayerPos(playerid, 1299.14,-794.77,1084.00);
   }
   return 1;
}
public OnPlayerLeaveDynamicCP(playerid, checkpointid)
{
   if(checkpointid == Checkpoint[0])
   {
   SetPlayerPos(playerid, 1402.6344,-1697.8345,13.5533);
   }
   return 1;
}
I use this one and when i enter the checkpoint it's telport me over and over and i can't move it's just teleport [help] please
Reply
#10

When you enter cp it executes code which makes you leave the cp
And when you leave the cp it is where you were [On the CP again]
Means when you enter you teleport that means you leave and when you leave the CP you are teleporting yourself to the same cp location
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)