Dynamic CP
#1

Can anyone give me a example how to create dynamic CP


like TestDCP = setdynamiccp
this my array

MissionGod[rand][x], MissionGod[rand][y], MissionGod[rand][z]


then enter and




Код:
public OnPlayerEnterCheckpoint(playerid)
{
	if(GetPlayerTeam(playerid) == 3)
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
			switch(Missiontest[playerid])
			{
				case 1:
				{
                                    test
				}
				case 2:
				{
	                            test
				}
			}
			return 1;
		}
	}
	return 1;
}
Reply
#2

Код:
CreateDynamicCP(Float:x, Float:y, Float:z, Float:size, worldid = -1, interiorid = -1, playerid = -1, Float:distance = 100.0);
Just replace the stuff like "Float" ecc with your coords and stuff


If you want to randomize that:

Example:

Just replace "x,y,z" with your coords
Код:
new Float: MissionGod[3][3] = {
{x,y,z},
{x,y,z},
{x,y,z},
{x,y,z}
};
This is an example command to trigger the Random Dynamic Checkpoint
Код:
CMD:randomCP(playerid,params[])
{
new rand;
rand = random(sizeof(MissionGod));
CreateDynamicCP(MissionGod[rand][0], MissionGod[rand][1], MissionGod[rand][2], Float:size, worldid = -1, interiorid = -1, playerid = -1, Float:distance = 100.0);
return 1;
}
Reply
#3

Quote:
Originally Posted by Flamehaze7
Посмотреть сообщение
Код:
CreateDynamicCP(Float:x, Float:y, Float:z, Float:size, worldid = -1, interiorid = -1, playerid = -1, Float:distance = 100.0);
Just replace the stuff like "Float" ecc with your coords and stuff


If you want to randomize that:

Example:

Just replace "x,y,z" with your coords
Код:
new Float: MissionGod[3][3] = {
{x,y,z},
{x,y,z},
{x,y,z},
{x,y,z}
};
This is an example command to trigger the Random Dynamic Checkpoint
Код:
CMD:randomCP(playerid,params[])
{
new rand;
rand = random(sizeof(MissionGod));
CreateDynamicCP(MissionGod[rand][0], MissionGod[rand][1], MissionGod[rand][2], Float:size, worldid = -1, interiorid = -1, playerid = -1, Float:distance = 100.0);
return 1;
}
it need to be with a tag?


Код:
DCP = CreateDynamicCP(MissionGod[rand][0], MissionGod[rand][1], MissionGod[rand][2], Float:size, worldid = -1, interiorid = -1, playerid = -1, Float:distance = 100.0);
you don't need to add

new rand;
rand = random(sizeof(MissionGod));
cause i already got it lol.

how about the enter?
Reply
#4

Quote:
Originally Posted by Ryan50
Посмотреть сообщение
how about the enter?
What do you need it to do when user enters cp ?
Reply
#5

Quote:
Originally Posted by Ahmad45123
Посмотреть сообщение
What do you need it to do when user enters cp ?
yes



i already have outside of the code
new DCP;
#define size 7.5



Код:
error 017: undefined symbol "worldid"
warning 215: expression has no effect
 error 017: undefined symbol "distance"
warning 215: expression has no effect
error 001: expected token: ";", but found ")"
fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.


Код:
DCP = CreateDynamicCP(missiongod[rand][x], missiongod[rand][y], missiongod[rand][z], Float:size, worldid = -1, interiorid = -1, playerid = -1, Float:distance = 100.0);
Reply
#6

Just remove all the rest variables to leave it default.
PHP код:
DCP CreateDynamicCP(missiongod[rand][x], missiongod[rand][y], missiongod[rand][z], 30); 
Just replace that 30 if you need bigger/smaller size.
Reply
#7

Quote:
Originally Posted by Ahmad45123
Посмотреть сообщение
Just remove all the rest variables to leave it default.
PHP код:
DCP CreateDynamicCP(missiongod[rand][x], missiongod[rand][y], missiongod[rand][z], 30); 
Just replace that 30 if you need bigger/smaller size.
new DCP;

Код:
warning 204: symbol is assigned a value that is never used: "DCP"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Reply
#8

Quote:
Originally Posted by Ryan50
Посмотреть сообщение
new DCP;

Код:
warning 204: symbol is assigned a value that is never used: "DCP"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
You have to let DCP do something to not get that warning.
Reply
#9

Quote:
Originally Posted by Flamehaze7
Посмотреть сообщение
You have to let DCP do something to not get that warning.
so how about the enter?




Код:
public OnPlayerEnterCheckpoint(playerid)
{
	if(GetPlayerTeam(playerid) == 3)
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
			switch(Missiontest[playerid])
			{
				case 1:
				{
                                    test
				}
				case 2:
				{
	                            test
				}
			}
			return 1;
		}
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)