SA-MP Forums Archive
Multiple messages - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Multiple messages (/showthread.php?tid=623760)



Multiple messages - GabiXx - 04.12.2016

i use this:
PHP код:
new CheckpointOne[MAX_PLAYERS];
new 
CheckpointTwo[MAX_PLAYERS];
new 
CheckpointThree[MAX_PLAYERS];
public 
OnPlayerEnterDynamicCP(playeridcheckpointid)
{
   if(
checkpointid == CheckpointOne[playerid])
   {
       
DestroyDynamicCP(checkpointid);
       
SendClientMessage(playeridCOLOR_YELLOW"Ai ajuns la destinatia dorita.");
       
RemovePlayerMapIcon(playerid1);
   }
   if(
checkpointid == CheckpointTwo[playerid])
   {
       
DestroyDynamicCP(checkpointid);
       
SendClientMessage(playeridCOLOR_YELLOW"Ai ajuns la destinatia dorita.");
       
RemovePlayerMapIcon(playerid2);
   }
   if(
checkpointid == CheckpointThree[playerid])
   {
       
DestroyDynamicCP(checkpointid);
       
SendClientMessage(playeridCOLOR_YELLOW"Ai ajuns la destinatia dorita.");
       
RemovePlayerMapIcon(playerid3);
   }
   return 
1;
}
if(
dialogid == 6)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
                
CheckpointOne[playerid] = CreateDynamicCP(377.8297,-2087.4912,7.83593.0, -1, -1, -150.0);
                
SetPlayerMapIcon(playerid1,377.8297,-2087.4912,7.83590COLOR_YELLOW0);
                
SendClientMessage(playeridCOLOR_YELLOW"Mergi la checkpoint-ul afisat pe harta.");
            }
            if(
listitem == 1)
            {
                
CheckpointTwo[playerid] = CreateDynamicCP(2000.4174,1568.4354,15.36723.0, -1, -1, -150.0);
                
SetPlayerMapIcon(playerid2,2000.4174,1568.4354,15.36720COLOR_YELLOW0);
                
SendClientMessage(playeridCOLOR_YELLOW"Mergi la checkpoint-ul afisat pe harta.");
            }
            if(
listitem == 2)
            {
                
CheckpointThree[playerid] = CreateDynamicCP(-1221.8596,460.7211,7.18753.0, -1, -1, -150.0);
                
SetPlayerMapIcon(playerid3,-1221.8596,460.7211,7.18750COLOR_YELLOW0);
                
SendClientMessage(playeridCOLOR_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(playeridCOLOR_YELLOW"Ai ajuns la destinatia dorita."); 
From OnPlayerEnterDynamicCP
And if go in cpthree, i will get 3x this message. Why?


Re: Multiple messages - GabiXx - 05.12.2016

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