Multiple messages
#1

i use this:
PHP код:
new CheckpointOne[MAX_PLAYERS];
new 
CheckpointTwo[MAX_PLAYERS];
new 
CheckpointThree[MAX_PLAYERS];
public 
OnPlayerEnterDynamicCP(playerid, checkpointid)
{
   if(
checkpointid == CheckpointOne[playerid])
   {
       
DestroyDynamicCP(checkpointid);
       
SendClientMessage(playerid, COLOR_YELLOW, "Ai ajuns la destinatia dorita.");
       
RemovePlayerMapIcon(playerid, 1);
   }
   if(
checkpointid == CheckpointTwo[playerid])
   {
       
DestroyDynamicCP(checkpointid);
       
SendClientMessage(playerid, COLOR_YELLOW, "Ai ajuns la destinatia dorita.");
       
RemovePlayerMapIcon(playerid, 2);
   }
   if(
checkpointid == CheckpointThree[playerid])
   {
       
DestroyDynamicCP(checkpointid);
       
SendClientMessage(playerid, COLOR_YELLOW, "Ai ajuns la destinatia dorita.");
       
RemovePlayerMapIcon(playerid, 3);
   }
   return 
1;
}
if(
dialogid == 6)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
                
CheckpointOne[playerid] = CreateDynamicCP(377.8297,-2087.4912,7.8359, 3.0, -1, -1, -1, 50.0);
                
SetPlayerMapIcon(playerid, 1,377.8297,-2087.4912,7.8359, 0, COLOR_YELLOW, 0);
                
SendClientMessage(playerid, COLOR_YELLOW, "Mergi la checkpoint-ul afisat pe harta.");
            }
            if(
listitem == 1)
            {
                
CheckpointTwo[playerid] = CreateDynamicCP(2000.4174,1568.4354,15.3672, 3.0, -1, -1, -1, 50.0);
                
SetPlayerMapIcon(playerid, 2,2000.4174,1568.4354,15.3672, 0, COLOR_YELLOW, 0);
                
SendClientMessage(playerid, COLOR_YELLOW, "Mergi la checkpoint-ul afisat pe harta.");
            }
            if(
listitem == 2)
            {
                
CheckpointThree[playerid] = CreateDynamicCP(-1221.8596,460.7211,7.1875, 3.0, -1, -1, -1, 50.0);
                
SetPlayerMapIcon(playerid, 3,-1221.8596,460.7211,7.1875, 0, COLOR_YELLOW, 0);
                
SendClientMessage(playerid, COLOR_YELLOW, "Mergi la checkpoint-ul afisat pe harta.");
            }
        }
    }
    return 
1;
} 
When i go in cp one all is ok. When i go in cptwo, i will get twice message:
PHP код:
SendClientMessage(playerid, COLOR_YELLOW, "Ai ajuns la destinatia dorita."); 
From OnPlayerEnterDynamicCP
And if go in cpthree, i will get 3x this message. Why?
Reply
#2

The id must be 65535 and must be same at all checkpoints(one, two, three)?
Reply


Forum Jump:


Users browsing this thread: