SA-MP Forums Archive
Startevent only id 0 .. - 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: Startevent only id 0 .. (/showthread.php?tid=278917)



Startevent only id 0 .. - BGMike - 24.08.2011

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;
	}



Re: Startevent only id 0 .. - =WoR=Varth - 24.08.2011

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



Re: Startevent only id 0 .. - BGMike - 24.08.2011

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


Re: Startevent only id 0 .. - =WoR=Varth - 24.08.2011

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;
    }



Re: Startevent only id 0 .. - BGMike - 24.08.2011

WORKED !

Thanks varthshenon !!!