CPS Checkpoint Streamer problem
#1

Hi guys, I am attempting to create a script for an Andromada Cargo Hatch, like on the SAP Server. On this script, when either the pilot, or copilot of the andromada type "/open-hatch" a checkpoint will appear somewhere around the andromada (Any ideas on how to set it always to go to the rear of the plane under cargo hatch, it all depends on where the plane is, angle etc... ?)

When the player enters the checkpoint, he SHOULD be teleported to the Cargo Interior, which is placed in the sky above Grove Street. The only problem is, for some reason, the teleport function doesn't work... The player can jump around all he likes in the checkpoint, and nothing happens. Also there is a second checkpoint, which is inside the Cargo Area, high in the sky, which teleports people to the back of the plane on enter, which I haven't been able to test as I cannot get to the Cargo Area, since the checkpoint 1 doesn't take me there :/

Here is the filterscript up to the teleport, if you spot any other problems, or things that could be improved / simplified please tell me.

Код:
#include <a_samp>
#include <cpsinc>

new Float:vX, Float:vY, Float:vZ;
new check1;
new check2;

public OnFilterScriptInit ()
{
	StartSystem();
    CreateObject(14548,2497.38403320,-1692.96166992,379.11077881,0.00000000,0.00000000,0.00000000);
	return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/open-hatch", true))
    {
    	new currentveh;
        currentveh = GetPlayerVehicleID(playerid);
		GetVehiclePos(currentveh,vX,vY,vZ);
		
		if(GetVehicleModel(currentveh) == 592)
		{
			check1 = CreateCheckpoint(-1, vX, vY-23.0, vZ, 5.0, 40);
			check2 = CreateCheckpoint(-1, 2497.42285, -1685.18432, 370.97482, 2.0, 40);
			SendClientMessage(playerid, 0xFFFFFFFF, "Andromada's Cargo Hatch is now open !");
			return 1;
		}
		else
		{
		    SendClientMessage(playerid, 0xFFFFFFFF, "You are not the Andromada's Pilot !");
		    return 1;
		}
	}
	if(!strcmp(cmdtext, "/close-hatch", true))
	{
	    new currentveh;
        currentveh = GetPlayerVehicleID(playerid);
        
		if(GetVehicleModel(currentveh) == 592)
		{
			DestroyCheckpoint(check1);
			DestroyCheckpoint(check2);
			SendClientMessage(playerid, 0xFFFFFFFF, "Andromada's Cargo Hatch is now closed !");
			return 1;
		}
		else
		{
		    SendClientMessage(playerid, 0xFFFFFFFF, "You are not the Andromada's Pilot !");
		    return 1;
		}
   }
	return 0;
}

public OnPlayerEnterStreamedCheckpoint(playerid, streamid)
{
	if(streamid == check1)
	{
		SetPlayerPos(playerid, 2497.02807, -1690.03454, 379.32736);
	}
	if(streamid == check2)
	{
    	SetPlayerPos(playerid, vX, vY-23.0, vZ);
	}
	return 1;
}
(Identation ruined by the Code tags )

The streamer used is the CPS Checkpoint Streamer by Domidon

For some reason the Wiki page he created for his streamer on the SA-MP Wiki, has been suggested for deletion.
So if anyone can help solve my problem, please help
Reply
#2

Can Anyone help ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)