Small issue with the Dynamic Checkpoints
#1

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.


PHP код:
shopcpp CreateDynamicCP(Map[ShopCPx],Map[ShopCPy],Map[ShopCPz], 5.000Map[Interior], -1100.0); 
PHP код:
evaccpp CreateDynamicCP(Map[CPx],Map[CPy],Map[CPz], 5.000Map[Interior], -1100.0); 
PHP код:
public OnPlayerEnterDynamicCP(playeridcheckpointid)
{
   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(playeridDIALOG_SHOPWEAPONSDIALOG_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;

Reply
#2

Try this out ..

PHP код:
public OnPlayerEnterDynamicCP(playeridcheckpointid)
{
   switch(
checkpointid)
   {
       case 
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);
            }
        }
    }
    case 
shopcpp:
    {
        if(
team[playerid] == TEAM_HUMAN)
        {
               
ShowPlayerDialog(playeridDIALOG_SHOPWEAPONSDIALOG_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;

Reply
#3

Quote:
Originally Posted by Krauser123
Посмотреть сообщение
Try this out ..

PHP код:
public OnPlayerEnterDynamicCP(playeridcheckpointid)
{
   switch(
checkpointid)
   {
       case 
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);
            }
        }
    }
    case 
shopcpp:
    {
        if(
team[playerid] == TEAM_HUMAN)
        {
               
ShowPlayerDialog(playeridDIALOG_SHOPWEAPONSDIALOG_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;

The switch statement will not unfortunately work under the OnPlayerEnterDynamicCheckpoint according to my knowledge, I tried it though and it doesn't work.
Reply
#4

I fixed the problem, it wasn't a problem with my coded checkpoints, it was a problem with the EvacType function, I solved it anyways, thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)