SA-MP Forums Archive
SetPlayerCheckPoint - 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: SetPlayerCheckPoint (/showthread.php?tid=610417)



SetPlayerCheckPoint - FishyZ - 23.06.2016

Is there a way to define checkpoints and get this?
for example
Код:
new Float:PizzamanCPs[8][4] =
{
  { 2236.3997,167.3553,28.1535, 3.0 },
  { 2363.3560,116.1356,28.4416, 3.0 },
  { 2374.1240,42.2868,28.4416, 3.0 },
  { 2392.2939,-54.9637,28.1536, 3.0 },
  { 1291.9042,281.5284,19.5614, 3.0 },
  { 1277.0186,370.8626,19.5547, 3.0 },
  { 1352.0980,348.4374,20.5009, 3.0 },
  { 1402.4236,286.2011,19.5547, 3.0 }
};
I want later on to get if the checkpoint is one of the above how can I do that? like

Код:
public OnPlayerEnterCheckpoint(playerid)
{
       if(CheckPoint = PizzamanCPs);
        {
       //do blablabla
        }
	return 1;
}
I do not know how to set the checkpoints for multiple so please help me I just gave the idea and I need help


Re: SetPlayerCheckPoint - WhiteGhost - 23.06.2016

PHP код:
 new PizzamanCPs[8];
PizzamanCps[0] =   SetPlayerCheckpoint(); //Create The Checkpoint
PizzamanCps[1] = SetPlayerCheckpoint(); //Same
PizzamanCps[2] = SetPlayerCheckpoint(); 
PizzamanCps[3] = SetPlayerCheckpoint(); 
PizzamanCps[4] = SetPlayerCheckpoint();
PizzamanCps[5] = SetPlayerCheckpoint(); 
PizzamanCps[6] = SetPlayerCheckpoint(); 
PizzamanCps[7] = SetPlayerCheckpoint(); 
PizzamanCps[8] = SetPlayerCheckpoint();  
public 
OnPlayerEnterCheckpoint(playerid)
{
       if(
CheckPoint PizzamanCPs[0]);
        {
       
//do blablabla
        
}
    return 
1;

Like that?


Re: SetPlayerCheckPoint - Abagail - 23.06.2016

The above will not work because checkpoints are not "created", they are set per player. You cannot set multiple checkpoints through the native checkpoint function set.


Re: SetPlayerCheckPoint - WhiteGhost - 23.06.2016

Quote:
Originally Posted by Abagail
Посмотреть сообщение
The above will not work because checkpoints are not "created", they are set per player. You cannot set multiple checkpoints through the native checkpoint function set.
Really? i didnt know that.Thanks.


Re: SetPlayerCheckPoint - FishyZ - 23.06.2016

Quote:
Originally Posted by WhiteGhost
Посмотреть сообщение
PHP код:
 new PizzamanCPs[8];
PizzamanCps[0] = CCP(); //Create The Checkpoint
PizzamanCps[1] = CCP(); //Same
PizzamanCps[2] = CCP(); 
PizzamanCps[3] = CCP(); 
PizzamanCps[4] = CCP();
PizzamanCps[5] = CCP(); 
PizzamanCps[6] = CCP(); 
PizzamanCps[7] = CCP(); 
PizzamanCps[8] = CCP();  
public 
OnPlayerEnterCheckpoint(playerid)
{
       if(
CheckPoint PizzamanCPs[0]);
        {
       
//do blablabla
        
}
    return 
1;

Like that?
You must define CCP, because when I put the Checkpoint cords it says invaild function or declaration, so no.
It's like making a function that doesn't exist.


Re: SetPlayerCheckPoint - WhiteGhost - 23.06.2016

Quote:
Originally Posted by FishyZ
Посмотреть сообщение
You must define CCP, because when I put the Checkpoint cords it says invaild function or declaration, so no.
It's like making a function that doesn't exist.
Thats where your creating the checkpoints recheck the code.


Re: SetPlayerCheckPoint - FishyZ - 23.06.2016

Well does anyone have a idea on how to do that? O:


Re: SetPlayerCheckPoint - Owen007 - 23.06.2016

new PizzamanCPs[8];


PizzamanCps[0] = SetPlayerCheckpoint(parameters here); //Create The Checkpoint
PizzamanCps[1] = SetPlayerCheckpoint(x,y,z); //Same
PizzamanCps[2] = SetPlayerCheckpoint();
PizzamanCps[3] = SetPlayerCheckpoint();
PizzamanCps[4] = SetPlayerCheckpoint();
PizzamanCps[5] = SetPlayerCheckpoint();
PizzamanCps[6] = SetPlayerCheckpoint();
PizzamanCps[7] = SetPlayerCheckpoint();
PizzamanCps[8] = SetPlayerCheckpoint();


public OnPlayerEnterDynamicCheckpoint(playerid)
{
if(CheckPoint = PizzamanCPs[0]);
{
//do blablabla
}
return 1;
}


just add parameters.


Re: SetPlayerCheckPoint - FishyZ - 23.06.2016

Quote:
Originally Posted by Owen007
Посмотреть сообщение
new PizzamanCPs[8];


PizzamanCps[0] = SetPlayerCheckpoint(parameters here); //Create The Checkpoint
PizzamanCps[1] = SetPlayerCheckpoint(x,y,z); //Same
PizzamanCps[2] = SetPlayerCheckpoint();
PizzamanCps[3] = SetPlayerCheckpoint();
PizzamanCps[4] = SetPlayerCheckpoint();
PizzamanCps[5] = SetPlayerCheckpoint();
PizzamanCps[6] = SetPlayerCheckpoint();
PizzamanCps[7] = SetPlayerCheckpoint();
PizzamanCps[8] = SetPlayerCheckpoint();


public OnPlayerEnterDynamicCheckpoint(playerid)
{
if(CheckPoint = PizzamanCPs[0]);
{
//do blablabla
}
return 1;
}


just add parameters.
It gives me these errors

Код:
C:\Users\Fishy\Desktop\New folder (2)\gamemodes\ROLEPLAY.pwn(58) : error 010: invalid function or declaration
Код:
new PizzamanCPs[8];


PizzamanCps[0] = SetPlayerCheckpoint(playerid, 2236.3997,167.3553,28.1535, 3.0);
here is the code ^


Re: SetPlayerCheckPoint - Owen007 - 23.06.2016

Quote:
Originally Posted by FishyZ
Посмотреть сообщение
It gives me these errors

Код:
C:\Users\Fishy\Desktop\New folder (2)\gamemodes\ROLEPLAY.pwn(58) : error 010: invalid function or declaration
Код:
new PizzamanCPs[8];


PizzamanCps[0] = SetPlayerCheckpoint(playerid, 2236.3997,167.3553,28.1535, 3.0);
here is the code ^
post your gamemode line no 56,57,58,59,60

i will check.