Disabling teleporting in hydra, rhino, hunter
#1

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
Reply
#2

https://sampwiki.blast.hk/wiki/GetVehicleModel
Reply
#3

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

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;
}
Reply
#5

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

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

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

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;
}
Reply
#9

Please?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)