Startevent only id 0 ..
#1

Hello, I want to make a command to my safe position and then with the command /joinevent other players can teleport to my position safe.Also I want the command to safe my Interior and VirtualWorld.
And here is the problem:
When I type the command she gets my coordinates X Y Z Angle, but the Interior and VirtualWorld take them only ID 0

Sorry for my bad english ..

Here's the codes:

Code:
new Float:TeleportEvent[6];


	if(strcmp(cmd, "/startevent", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
		    if (PlayerInfo[playerid][pAdmin] >= 5)
			{
                                new pevent;
                                pevent = ReturnUser(tmp);
                                event = 1;
				GetPlayerPos(playerid, TeleportEvent[0],TeleportEvent[1],TeleportEvent[2]);
				GetPlayerFacingAngle(playerid, TeleportEvent[3]);
				GetPlayerInterior(pevent);
				GetPlayerVirtualWorld(pevent);
			}
		}
		return 1;
	}


	if(strcmp(cmd, "/joinevent", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
		    if(event == 1)
			{
				if (GetPlayerState(playerid) != 1)
				{
				    SendClientMessage(playerid, COLOR_ADMIN, "TEST");
				}
				else
				{
				    new pevent;
				    SetPlayerPos(playerid, TeleportEvent[0],TeleportEvent[1],TeleportEvent[2]);
				    SetPlayerFacingAngle(playerid, TeleportEvent[3]);
				    SetPlayerInterior(playerid, GetPlayerInterior(pevent));
				    SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(pevent));
				}
			}
			if(event == 0)
			{
			SendClientMessage(playerid, COLOR_ADMIN, "TEST");
			}
		}
		return 1;
	}
Reply
#2

pawn Code:
new pevent;//This should be global, not local. Move this to top of your script.
Reply
#3

Quote:
Originally Posted by varthshenon
View Post
pawn Code:
new pevent;//This should be global, not local. Move this to top of your script.
I did this, but now not even take the Interior and VirtualWorld from ID 0
Reply
#4

pawn Code:
new Float:TeleportEvent[6],//6?
    Interior,VW;


    if(strcmp(cmd, "/startevent", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] >= 5)
            {
                event = 1;
                GetPlayerPos(playerid, TeleportEvent[0],TeleportEvent[1],TeleportEvent[2]);
                GetPlayerFacingAngle(playerid, TeleportEvent[3]);
                Interior = GetPlayerInterior(playerid);
                VW = GetPlayerVirtualWorld(playerid);
            }
        }
        return 1;
    }


    if(strcmp(cmd, "/joinevent", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(event == 1)
            {
                if (GetPlayerState(playerid) != 1) SendClientMessage(playerid, COLOR_ADMIN, "TEST");
                else
                {
                    SetPlayerPos(playerid, TeleportEvent[0],TeleportEvent[1],TeleportEvent[2]);
                    SetPlayerFacingAngle(playerid, TeleportEvent[3]);
                    SetPlayerInterior(playerid,Interior);
                    SetPlayerVirtualWorld(playerid,VW);
                }
            }
            else SendClientMessage(playerid, COLOR_ADMIN, "TEST");
        }
        return 1;
    }
Reply
#5

WORKED !

Thanks varthshenon !!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)