#include <a_samp>
#include <CheckpointManager>
// Checkpoint Definitions
#define BANK_CITYPLANNING 0
// Add Checkpoints
// Note: GLOBAL_OWNER_ID is defined at CheckpointManager.inc as -1
CreateCheckpoint(GLOBAL_OWNER_ID, BANK_CITYPLANNING, 362.2479, 173.5770, 1008.3828);
SetCheckpointInterior(BANK_CITYPLANNING, 3);
// Initializing the CheckpointManager
StartCheckpointSeeking();
(...)
public OnPlayerEnterCheckpoint(playerid){
VerifyCheckpoint(playerid); // Asks the ChpManager to check this checkpoint and fire the next function
return 1;
}
public OnCheckpointEnter(playerid, checkpointid){
switch(checkpointid)
{
// BANKS
case BANK_CITYPLANNING: // The checkpoint ID we specified when we created the checkpoint
{
SendClientMessage(playerid, COLOR_MESSAGE, "Welcome to the San Andreas Bank");
SendClientMessage(playerid, COLOR_MESSAGE, "To deposit money type «/bank deposit [ammount]»");
SendClientMessage(playerid, COLOR_MESSAGE, "To withraw money type «/bank withraw [ammount]»");
SendClientMessage(playerid, COLOR_MESSAGE, "To request a loan type «/bank loan [ammount]»");
}
}
return 1;
}
Originally Posted by Oxside
REALLY NICE
But the post looks some gaotic! |
Originally Posted by Damien [T-RP
]
Quote:
|
#include <a_samp>
#include <CheckpointManager>
#define CP_1 0
#define CP_2 1
#define CP_3 2
#define CP_4 3
#define CP_5 4
public OnGameModeInit()
{
CreateCheckpoint(GLOBAL_OWNER_ID, CP_1, 1958.3783,1343.1572,15.3746);
CreateCheckpoint(GLOBAL_OWNER_ID, CP_2, 2031.7180,1366.5226,10.8203);
CreateCheckpoint(GLOBAL_OWNER_ID, CP_3, 1988.9958,1422.4563,9.1094);
CreateCheckpoint(GLOBAL_OWNER_ID, CP_4, 1957.9187,1447.3143,10.8203);
CreateCheckpoint(GLOBAL_OWNER_ID, CP_5, 1910.4789,1496.8055,13.6717);
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
StartCheckpointSeeking();
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
VerifyCheckpoint(playerid);
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
VerifyCheckpointe(playerid);
return 1;
}
public OnCheckpointEnter(playerid, checkpointid){
switch(checkpointid)
{
case CP_1:
{
SendClientMessage(playerid, 0xFFFFFFAA, "enter CP_1 ");
}
case CP_2:
{
SendClientMessage(playerid, 0xFFFFFFAA, "enter CP_2 ");
}
case CP_3:
{
SendClientMessage(playerid, 0xFFFFFFAA, "enter CP_3 ");
}
case CP_4:
{
SendClientMessage(playerid, 0xFFFFFFAA, "enter CP_4 ");
}
case CP_5:
{
SendClientMessage(playerid, 0xFFFFFFAA, "enter CP_5 ");
}
}
return 1;
}
public OnCheckpointEXIT(playerid, checkpointid){
switch(checkpointid)
{
case CP_1:
{
SendClientMessage(playerid, 0xFFFFFFAA, "exit CP_1 de test");
}
case CP_2:
{
SendClientMessage(playerid, 0xFFFFFFAA, "exit CP_2 de test");
}
case CP_3:
{
SendClientMessage(playerid, 0xFFFFFFAA, "exit CP_3 de test");
}
case CP_4:
{
SendClientMessage(playerid, 0xFFFFFFAA, "exit CP_4 de test");
}
case CP_5:
{
SendClientMessage(playerid, 0xFFFFFFAA, "exit CP_5 de test");
}
}
return 1;
}
CreateCheckpoint(ownerid, chpid, Float:posX, Float:posY, Float:posZ, Float:size);
Here you are: http://blantas.paste.lt/paste/093419...902253927576bb I added a size parameter: Code: CreateCheckpoint(ownerid, chpid, FloatosX, FloatosY, FloatosZ, Floatize); Wink |
Good work, but could you explain me how do I make a command only available when player is in marker / checkpoint? |
Originally Posted by mr.b
|
Originally Posted by mr.b
Quote:
{ if(IsPlayerInCheckpoint(playerid)) { //do anything here return 1; } here https://sampwiki.blast.hk/wiki/IsPlayerInCheckpoint |
Good work, but could you explain me how do I make a command only available when player is in marker / checkpoint? if (strcmp(cmdtext, "/command", true)==0) { if(IsPlayerInCheckpoint(playerid)) { //do anything here return 1; } here Cheesy https://sampwiki.blast.hk/wiki/IsPlayerInCheckpoint I know that, but if I have many checkpoints, and only available in ONE of them. |
new cp1; |
cp1 = CreateCheckpoint(ownerid, chpid, FloatosX, FloatosY, FloatosZ, Floatize); |
if (strcmp(cmdtext, "/command", true)==0) { if(IsPlayerInCheckpoint(playerid)==cp1) { //do anything here return 1; } |
#include <a_samp> #include <CheckpointManager>
#define STORE_ONE 0
CreateCheckpoint(GLOBAL_OWNER_ID, STORE_ONE, 2214.2620,2526.0508,10.8203); StartCheckpointSeeking();
VerifyCheckpoint(playerid);
public OnCheckpointEnter(playerid, checkpointid){ switch(checkpointid) { case STORE_ONE: //Line 986,This is where the error is!! { SetPlayerHealth(playerid,105); } } return 1; }
C:\Users\Avi\Desktop\Dm server\gamemodes\Dm-S.pwn(986) : error 008: must be a constant expression; assumed zero