Find integer from all the files
#1

I need to find Integer from all the files, for example
I want to get the integer from all the files who exists who named numbers.. i'll explain you.

I created a command "/createtp" and "/endtp"
when you type /createtp It's create 3dlabeltext "Teleport %i"
the %i is the ID of the TP.

well, I want to create a command who will Teleport me from the Teleport to the other Teleport, (Teleport points...)
means if i'll stand at the X Y Z of the teleport its will tp me to the X Y Z of the other side of the teleport...

so I want to make a command (/usetp) and It's will get my position and if I'm at the position of the TP it's will Teleport me to the other side of the TP.

So I need to get the X Y Z from all the files to check if the player who typing the command /usetp is near to one of the teleports.
Reply
#2

Create an enumerator for the teleports containing x1, x2, y1, y2, z1, z2, radius [optional], and whether it's created or not. Then it's simple, just create commands to set a teleport position down, then in the /usetp command

Код:
fpr(new id = 0; id < MAX_TELEPORTS; id++)
{
       IsPlayerInRangeOfPoint(playerid, TPInfo[id][radius], TPInfo[id][x], TPInfo[id][y], TPInfo[id][z]) && TPInfo[id][Created] == true)
       {
              SetPlayerPos(playerid, TPInfo[id][x2], TPInfo[id][y2], TPInfo[id][z2]);
       }
}
Reply
#3

Quote:
Originally Posted by Divergent
Посмотреть сообщение
Create an enumerator for the teleports containing x1, x2, y1, y2, z1, z2, radius [optional], and whether it's created or not. Then it's simple, just create commands to set a teleport position down, then in the /usetp command

Код:
fpr(new id = 0; id < MAX_TELEPORTS; id++)
{
       IsPlayerInRangeOfPoint(playerid, TPInfo[id][radius], TPInfo[id][x], TPInfo[id][y], TPInfo[id][z]) && TPInfo[id][Created] == true)
       {
              SetPlayerPos(playerid, TPInfo[id][x2], TPInfo[id][y2], TPInfo[id][z2]);
       }
}
okay, well It's will get integers from all the files?
Reply
#4

Quote:
Originally Posted by Divergent
Посмотреть сообщение
Create an enumerator for the teleports containing x1, x2, y1, y2, z1, z2, radius [optional], and whether it's created or not. Then it's simple, just create commands to set a teleport position down, then in the /usetp command

Код:
fpr(new id = 0; id < MAX_TELEPORTS; id++)
{
       IsPlayerInRangeOfPoint(playerid, TPInfo[id][radius], TPInfo[id][x], TPInfo[id][y], TPInfo[id][z]) && TPInfo[id][Created] == true)
       {
              SetPlayerPos(playerid, TPInfo[id][x2], TPInfo[id][y2], TPInfo[id][z2]);
       }
}
Quote:
Originally Posted by ******
Посмотреть сообщение
Basically, you need to load all the files in advance and store them in an array. You can't search through the files when someone uses the command (technically you can, but it will KILL your performance).
Umm, what do you mean "(technically you can, but it will KILL your performance).", how can i do this?
and how can i load all the files in advance and store them in an array?
you can send me link for a guide please?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)