Please help me with this
#1

Checkpoints won't display when i go ingame from my script.

Here's my pastebin.

http://pastebin.com/f2dd7150

Lines are 157 - 174 (the cords of checkpoint)


here's some code.



Код:
// checkpoint name defines

#define CP_STATION1  0
//----------------------------------

#define MAX_POINTS 1

new Float:checkpoints[MAX_POINTS][4] = {
{321.0736,1121.1912,1083.8828,5.0} //drug house checkpoint
};

new checkpointType[MAX_POINTS] = {
CP_STATION1 // not used just example THE CHECKPOINT NAME
};

new Float:checkCoords[MAX_POINTS][4] = { //checkpoint cords
{321.0736, 1121.1912, 1083.8828, 164.8358} //drug house
};
Reply
#2

Anyone.....
Reply
#3

i am using dragsta CPS and it works OK! Try to search ''Dragsta CPS'' or ''Dragsta Checkpoint Streamer''
Reply
#4

Yeah, But i would just like to know whats wrong with this one in my script
Reply
#5

anyone can help?
Reply
#6

I hate bumping my thread, but getting no replies at all is really frustrating
Reply
#7

i'm currently on phone, so i cant help you right now, but i'll post it here, or you can also ask me on messenger. (if you are the same killdahobo as i believe, you should know me). So no need to bumb anymore
Reply
#8

Quote:
Originally Posted by Johnson_boy
i'm currently in phone, so i cant help you right now, but i'll post it here, or you can also ask me on messenger. (if you are the same killdahobo as i believe, you should know me). So no need to bumb anymore
I am the one your talking about lol. I emailed you.
Reply
#9

You weren't online, so i decided to tell it here.

So, you can create checkpoints without a streamer, but then, you can't use smoothly more than one checkpoint.
But if you need only 1 checkpoint, you can create it like this:

pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerCheckpoint(playerid, 321.0736, 1121.1912, 1083.8828, 3);
    return 1;
}
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    SendClientMessage(playerid, 0xFFFFFFFF, "You entered Checkpoint");
    return 1;
}

But, if you want to use more than just one checkpoint, i suggest you to get some checkpoint streamer.
I personally like CPS, but you can use any streamer you want.

Instructions for CPS:
Download



How do I use it?
It is very simple:
1. Download the .inc file from one of the links below
2. Put the .inc file in your 'includes' directory.
3. Include it into your GM/FS with '#include <cps>'
4. Make the following additions to your script:
1. Add 'StartSystem();' to OnGameModeInit/OnFilterScriptInit.
2. Add 'ClearVars(playerid);' to OnPlayerConnect.
3. Add 'SyncCheckpoints(playerid);' to OnPlayerConnect.
4. Add 'CheckpointCheck(playerid);' to the TOP of OnPlayerEnterCheckpoint.
5. Add the following callback to your script:
pawn Код:
public OnPlayerEnterStreamedCheckpoint(playerid, streamid)
{
  return 1;
}
5. You can now use the following functions:
pawn Код:
CreateCheckpoint(playerid, Float:cpX, Float:cpY, Float:cpZ, Float:cpS, Float:viewdiss); //Will create a streamed checkpoint for the specified player. Use -1 as playerid for all players
DestroyCheckpoint(cPid); //Destroys a checkpoint.
TogglePlayerCheckpoint(playerid, cpid, bool:toggle); //Toggles a checkpoint on/off for a player.


So if you decided yo use CPS, i'll give you one example how to create some checkpoints and use the checkpoints.

Before Main:
pawn Код:
new CP1;
new CP2;
new CP3;
new CP4;
new CP5;
new CP6;
new CP7;
pawn Код:
public OnPlayerConnect(playerid)
{
  ClearVars(playerid);
  SyncCheckpoints(playerid);
    return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
    CP1 = CreateCheckpoint(playerid, 2526.6646,-1733.3737,13.1100, 5, 20);
    CP2 = CreateCheckpoint(playerid, 2492.4700,-1731.9531,13.1100, 5, 40);
    CP3 = CreateCheckpoint(playerid, 2435.5293,-1731.1017,13.3086, 5, 40);
    CP4 = CreateCheckpoint(playerid, 2372.0400,-1730.5052,13.1101, 5, 40);
    CP5 = CreateCheckpoint(playerid, 2302.9905,-1730.4089,13.1101, 5, 40);
    CP6 = CreateCheckpoint(playerid, 2253.2922,-1730.3390,13.1100, 5, 40);
    CP7 = CreateCheckpoint(playerid, 2213.5447,-1730.2816,13.1307, 5, 40);
   
    TogglePlayerCheckpoint(playerid, CP1, true);
    TogglePlayerCheckpoint(playerid, CP2, true);
    TogglePlayerCheckpoint(playerid, CP3, true);
    TogglePlayerCheckpoint(playerid, CP4, true);
    TogglePlayerCheckpoint(playerid, CP5, true);
    TogglePlayerCheckpoint(playerid, CP6, true);
    TogglePlayerCheckpoint(playerid, CP7, true);

    return 1;
}
pawn Код:
public OnPlayerEnterStreamedCheckpoint(playerid, streamid)
{
    if(streamid == CP1) return SendClientMessage(playerid, 0xFFFFFFFF, "CP1");
    if(streamid == CP2) return SendClientMessage(playerid, 0xFFFFFFFF, "CP2");
    if(streamid == CP3) return SendClientMessage(playerid, 0xFFFFFFFF, "CP3");
    if(streamid == CP4) return SendClientMessage(playerid, 0xFFFFFFFF, "CP4");
    if(streamid == CP5) return SendClientMessage(playerid, 0xFFFFFFFF, "CP5");
    if(streamid == CP6) return SendClientMessage(playerid, 0xFFFFFFFF, "CP6");
    if(streamid == CP7) return SendClientMessage(playerid, 0xFFFFFFFF, "CP7");

  return 1;
}
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
  CheckpointCheck(playerid);
return 1;
}

I hope this helps you Killdahobo.

Reply
#10

Johnson, I will try this right now, I thank you for spending your time helping me



Edit: This is my first checkpoint (CP1) I'm trying to add another thing to make a checkpoint that teleports me to an interior, but it's not working. Heres my CP1. Can you show me an example of how to add to this code and make it work IG?

I just need you to show me how to add something that teleports me to an interior in CP2. You can make up the cords/interior. I just need an example. Thanks


Код:
public OnPlayerEnterStreamedCheckpoint(playerid, streamid)
{
if(streamid == CP1)
{
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
if(gTeam[playerid] == TEAM_COP || gTeam[playerid] == TEAM_ARMY || gTeam[playerid] == TEAM_CASSEC) {
SendClientMessage(playerid, 0xA9A9A9AA, "|_Las Santos Drug House_|");
SendClientMessage(playerid, 0xE9967AAA, "Go away... pig! ");
return 1;
}
SendClientMessage(playerid, 0xA9A9A9AA, "|_Las Venturas Drug House_|");
SendClientMessage(playerid, 0xE9967AAA, "Type /buydrugs [ID] to buy some drugs");
SendClientMessage(playerid, 0xE9967AAA, "1 - Buy 10 grams of drugs ($2000)");
SendClientMessage(playerid, 0xE9967AAA, "2 - Buy 100 grams of drugs ($20000)");
SendClientMessage(playerid, 0xE9967AAA, "3 - Buy 500 grams of drugs ($100000)");
SendClientMessage(playerid, 0xE9967AAA, "4 - Buy 1000 grams of drugs ($150000) - Dealers Only");
SendClientMessage(playerid, 0xE9967AAA, "5 - Buy DrugBag ($1000) - Cops cant find your drugs if they search you");
{
}
}
}
return 1;
}


Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)