14.03.2019, 14:00
im making an event system and i want to do it like this and i don't kniw how
When an admin is using /startevent,i want to save his position
When a player types /tpevent i want him teleported to the admin's saved position
What i did so far teleports a player to the admin's position but its not the same position for everyone ,like,it teleports each player to the admin's position in that moment,when the player types the command
CMDtartevent(playerid, params[])
{
EventOrganizer[playerid] = 1;
return 1;
}
CMD:tpevent(playerid, params[])
{
foreach(new i : Player){
if(EventOrganizer[i] == 1){
GetPlayerPos(i, Float, Float:y, Float:z);
}
SetPlayerPos(playerid, Float, Float:y, Float:z);
}
return 1;
}
When an admin is using /startevent,i want to save his position
When a player types /tpevent i want him teleported to the admin's saved position
What i did so far teleports a player to the admin's position but its not the same position for everyone ,like,it teleports each player to the admin's position in that moment,when the player types the command
CMDtartevent(playerid, params[])
{
EventOrganizer[playerid] = 1;
return 1;
}
CMD:tpevent(playerid, params[])
{
foreach(new i : Player){
if(EventOrganizer[i] == 1){
GetPlayerPos(i, Float, Float:y, Float:z);
}
SetPlayerPos(playerid, Float, Float:y, Float:z);
}
return 1;
}