SA-MP Forums Archive
Disabling teleporting in hydra, rhino, hunter - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Disabling teleporting in hydra, rhino, hunter (/showthread.php?tid=82733)



Disabling teleporting in hydra, rhino, hunter - Daplayah - 20.06.2009

I'm using dcmd, and I need something to disable teleporting in a hydra, rhino and hunter

Please explain this to me, and tell me what to add where, otherwise I'll screw it up

Thanks

- DP


Re: Disabling teleporting in hydra, rhino, hunter - SpiderPork - 20.06.2009

https://sampwiki.blast.hk/wiki/GetVehicleModel


Re: Disabling teleporting in hydra, rhino, hunter - Daplayah - 20.06.2009

I'm quite a noob on this, can't you tell me what to add where


Re: Disabling teleporting in hydra, rhino, hunter - SpiderPork - 20.06.2009

pawn Код:
if(strcmp(cmd, "/command", true) == 0)
{
   new vehicleid = GetPlayerVehicleID(playerid);

   if(GetVehicleModel(vehicleid) == [hydra ID] || GetVehicleModel(vehicleid) == [hunter ID] || GetVehicleModel(vehicleid) == [rhino ID])
     return SendClientMessage(playerid, COLOR, "ERROR: You can't teleport with a hunter, hydra or rhino!");
   else
     return SetVehiclePos(vehicleid, x, y, z);

   if(!IsPlayerInAnyVehicle(playerid))return SetPlayerPos(playerid, x, y, z);
   return 1;
}



Re: Disabling teleporting in hydra, rhino, hunter - Daplayah - 20.06.2009

Thanks, can anyone confirm that this is going to work?


Re: Disabling teleporting in hydra, rhino, hunter - Klutty - 20.06.2009

Quote:
Originally Posted by Daplayah
Thanks, can anyone confirm that this is going to work?
It will work.


Re: Disabling teleporting in hydra, rhino, hunter - SpiderPork - 20.06.2009

It might look like it won't work because of different style of identation, but it will.


Re: Disabling teleporting in hydra, rhino, hunter - Daplayah - 20.06.2009

I tried it but did something wrong, could you please add it in here?
Thanks

Код:
dcmd_sfair(playerid, params[])
{
	if(sscanf(params, "s", tmp))
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
		  SetVehiclePosition(GetPlayerVehicleID(playerid), -1236.044, 42.641, 13.936, 224.0);
		}
		else
		{
		  SetPlayerPosition(playerid, -1268.651, 21.880, 13.948, 134.0);
		}

		SendClientMessage(playerid, COLOR_GREENYELLOW, "Welcome to SFair! Also try '/up' and '/tunnel'");
		TeleMSG(playerid, "/sfair");
	}
	else
	{
	  if(!strcmp(tmp, "tunnel", true))
	  {
	    if(!IsPlayerInAnyVehicle(playerid))
			{
				SetPlayerPosition(playerid, -1544.7047, -943.1182, 414.9908, 342.3444);
				SetTimerEx("unfreezePutInVehicle", 5000, false, "idffff", playerid, -1, -1544.7047, -943.1182, 414.9908, 342.3444);
			}
			else
			{
			  SetVehiclePosition(GetPlayerVehicleID(playerid), -1544.7047, -943.1182, 414.9908, 342.3444);
			  SetTimerEx("unfreezePutInVehicle", 5000, false, "idffff", playerid, GetPlayerVehicleID(playerid), -1544.7047, -943.1182, 414.9908, 342.3444);
			}
			SetPlayerCameraPos(playerid, -1531.7843, -913.3820, 425.6829);
			SetPlayerCameraLookAt(playerid, -1544.7047, -943.1182, 414.9908);
			
			TeleMSG(playerid, "/sfair tunnel");
			TogglePlayerControllable(playerid, false);
			InfoTD_MSG(playerid, 5200, "~r~~h~~h~Wait until the objects load...");
		}
		else if(!strcmp(tmp, "up", true))
		{
 			if(!IsPlayerInAnyVehicle(playerid))
			{
				SetPlayerPosition(playerid, -150.5335, -882.7545, 408.6168, 56.5209);
				SetTimerEx("unfreezePutInVehicle", 5000, false, "idffff", playerid, -1, -150.5335, -882.7545, 408.6168, 56.5209);
			}
			else
			{
			  SetVehiclePosition(GetPlayerVehicleID(playerid), -150.5335, -882.7545, 408.6168, 56.5209);
			  SetTimerEx("unfreezePutInVehicle", 5000, false, "idffff", playerid, GetPlayerVehicleID(playerid), -150.5335, -882.7545, 408.6168, 56.5209);
			}
			SetPlayerCameraPos(playerid, -176.4613, -869.1027, 413.3461);
			SetPlayerCameraLookAt(playerid, -150.5335, -882.7545, 408.6168);
			
			TeleMSG(playerid, "/sfair up");
			TogglePlayerControllable(playerid, false);
			InfoTD_MSG(playerid, 5200, "~r~~h~~h~Wait until the objects load...");
		}
		else
		{
			if(IsPlayerInAnyVehicle(playerid))
			{
			  SetVehiclePosition(GetPlayerVehicleID(playerid), -1236.044, 42.641, 13.936, 224.0);
			}
			else
			{
			  SetPlayerPosition(playerid, -1268.651, 21.880, 13.948, 134.0);
			}

			SendClientMessage(playerid, COLOR_GREENYELLOW, "Welcome to SFair! Also try '/sfair up' and '/sfair tunnel'");
			TeleMSG(playerid, "/sfair");
		}
	}

	#pragma unused params
	return true;
}



Re: Disabling teleporting in hydra, rhino, hunter - Daplayah - 20.06.2009

Please?