18.02.2017, 19:17
So, basically I have an issue with the checkpoints. I'm currently using the streamer's dynamic checkpoints.
Let me explain you the issue I've been facing;
I got two checkpoints, they are named Evacuation Checkpoint and Shop Checkpoint. First checkpoints streams and appears works fine, but the second checkpoint appears doesn't work like it's supposed to be.
Here's an example;
Shop checkpoint appeared first, it would work perfectly with no issues, and when the evacuation checkpoints appears as the second checkpoint, it doesn't work, when I enter it, nothing happens although I should be using the OnPlayerEnterDynamicCheckpoint correctly, but not sure if i'm doing it correctly or not, please take a look on the code.
Let me explain you the issue I've been facing;
I got two checkpoints, they are named Evacuation Checkpoint and Shop Checkpoint. First checkpoints streams and appears works fine, but the second checkpoint appears doesn't work like it's supposed to be.
Here's an example;
Shop checkpoint appeared first, it would work perfectly with no issues, and when the evacuation checkpoints appears as the second checkpoint, it doesn't work, when I enter it, nothing happens although I should be using the OnPlayerEnterDynamicCheckpoint correctly, but not sure if i'm doing it correctly or not, please take a look on the code.
PHP код:
shopcpp = CreateDynamicCP(Map[ShopCPx],Map[ShopCPy],Map[ShopCPz], 5.00, 0, Map[Interior], -1, 100.0);
PHP код:
evaccpp = CreateDynamicCP(Map[CPx],Map[CPy],Map[CPz], 5.00, 0, Map[Interior], -1, 100.0);
PHP код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == evaccpp)
{
if(team[playerid] == TEAM_HUMAN)
{
new string[256];
if(Map[EvacType] == 1)
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,-1408.2051,-970.8841,198.9738);
format(string,sizeof(string), ""chat""COL_LGREEN" %s made it to evacuation point and has received 1 coin!",PlayerName(playerid));
SendClientMessageToAll(-1,string);
//DisablePlayerCheckpoint(playerid);
CurePlayer(playerid);
GivePlayerXP(playerid,50);
pInfo[playerid][pEvac]++;
pInfo[playerid][pCoins]++;
SetPlayerColor(playerid,COLOR_YELLOW);
}
if(Map[EvacType] == 2)
{
SetPlayerPos(playerid,3024.4983,447.9744,14.7813);
SetPlayerInterior(playerid,0);
format(string,sizeof(string), ""chat""COL_LGREEN" %s made it to the water evacuation point and has received 1 coin!",PlayerName(playerid));
SendClientMessageToAll(-1,string);
//DisablePlayerCheckpoint(playerid);
CurePlayer(playerid);
GivePlayerXP(playerid,50);
pInfo[playerid][pEvac]++;
pInfo[playerid][pCoins]++;
SetPlayerColor(playerid,COLOR_YELLOW);
}
if(Map[EvacType] == 3)
{
SetPlayerPos(playerid,285.5,2510.30004882817,121.5);
SetPlayerInterior(playerid,0);
format(string,sizeof(string), ""chat""COL_LGREEN" %s made it to the helicopter evacuation point and has received 1 coin!",PlayerName(playerid));
SendClientMessageToAll(-1,string);
//DisablePlayerCheckpoint(playerid);
CurePlayer(playerid);
GivePlayerXP(playerid,50);
pInfo[playerid][pEvac]++;
pInfo[playerid][pCoins]++;
SetPlayerColor(playerid,COLOR_YELLOW);
}
}
}
if(checkpointid == shopcpp)
{
if(team[playerid] == TEAM_HUMAN)
{
ShowPlayerDialog(playerid, DIALOG_SHOPWEAPONS, DIALOG_STYLE_TABLIST_HEADERS, "Buy Weapon",
"Weapon\tPrice\tAmmo\n\
Desert Eagle\t3 Coins\t40\n\
Colt 45\t1 Coin\t50\n\
SD Pistol\t2 Coins\t60\n\
Normal Shotgun\t4 Coins\t50\n\
Combat Shotgun\t7 Coins\t50\n\
MP5\t6 Coins\t120",
"Purchase", "Cancel");
}
}
return 1;
}