SA-MP Forums Archive
Help /goto command in Minigame - 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: Help /goto command in Minigame (/showthread.php?tid=284308)



Help /goto command in Minigame - HotPlayer - 18.09.2011

Hello all,
i have created minigames and i want to create a goto command
just for player who are out of minigame
so i have this code:
I have put this:
Код:
new inminigame[MAX_PLAYERS];
Then the goto command here:
Код:
dcmd_goto(playerid,params[])
{
    if(inminigame[playerid] == 0)
    {
		if(!strlen(params)) return
		SendClientMessage(playerid, LIGHTBLUE2, "Use this: /goto [PlayerID]");
	    new player1;
		new string[128];
		if(!IsNumeric(params))
		player1 = ReturnPlayerID(params);
	   	else player1 = strval(params);
	 	if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid)
		 {
			SendCommandToAdmins(playerid,"Goto");
			new Float:x, Float:y, Float:z;	GetPlayerPos(player1,x,y,z);
			SetPlayerInterior(playerid,GetPlayerInterior(player1));
			SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(player1));
			if(GetPlayerState(playerid) == 2)
			{
			SetVehiclePos(GetPlayerVehicleID(playerid),x+3,y,z);
			LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(player1));
			SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),GetPlayerVirtualWorld(player1));
			}
			else SetPlayerPos(playerid,x+2,y,z);
			format(string,sizeof(string),"|- You have Teleported to \"%s\" -|", pName(player1));
			return SendClientMessage(playerid,BlueMsg,string);
		}
	  else return ErrorMessages(playerid, 4);
	  }
	  else return SendClientMessage(playerid,COLOR_RED,"[ERROR]: You cant /goto players, while you are in Mini-Game. First use: /leavemg");
}
i Use LuxAdmin system...
So i need a help
PLZ hElp
Thanks!


Re: Help /goto command in Minigame - HotPlayer - 18.09.2011

What info need?


Re: Help /goto command in Minigame - Kingunit - 18.09.2011

What exactly went wrong? Give us some more information.


Re: Help /goto command in Minigame - HotPlayer - 18.09.2011

this its do not work if i am in minigame
i need this to dont work if i am in any minigame
i need it to work if i am out of minigame
.....


Re: Help /goto command in Minigame - park4bmx - 18.09.2011

Well did you set that inminigame[playerid]=1 is to 1 when entered the minigame ?


Re: Help /goto command in Minigame - [WoF]Sonny - 18.09.2011

Do you run admin script from GM or FS