SA-MP Forums Archive
2 doubts - 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: 2 doubts (/showthread.php?tid=155516)



2 doubts - keller012 - 18.06.2010

1-I created a teleport to a derby, the player went into the Derby with a car.
I wonder how do I make the player die if he leaves the car.

Code I used.

Код:
	if(strcmp(cmdtext, "/openderby", true) == 0)
	{
	  if (PlayerInfo[playerid][pAdmin] >= 1)
		{
		  if(!dbon)
			{
			  dbon = true;
			  for(new i; i < MAX_PLAYERS; i++)
				{
	  				GameTextForPlayer(i, "~g~type /goderby",1000,3);
	  			}
			}
			else if(dbon)
			{
			  dbon = false;
			  for(new i; i < MAX_PLAYERS; i++)
				{
	  				GameTextForPlayer(i, "~r~DERBY CLOSED",1000,3);
	  			}
			}
		}
		else
		{
		  SendClientMessage(playerid, COLOR_GRAD1, "  You are not authorized to use this command !");
		}
	}
 if(strcmp(cmdtext, "/GOderby", true) == 0)
	{
    if(!dbon) return SendClientMessage(playerid,0xAA3333AA,"The Event Derby is not released !");
		SetPlayerInterior(playerid,15);
		{
		 LastInterior = GetPlayerInterior(playerid);
	   derbycar = CreateVehicle(444,-1378.8278,991.5210,1024.3533,0.0058,0,0, 600);
     PutPlayerInVehicle(playerid, derbycar, 0);
     ResetPlayerWeapons(playerid);
	   SetPlayerHealth(playerid, 100.0);
	   TogglePlayerControllable(playerid, 1);
	   SetPlayerVirtualWorld(playerid, 0);
	   GameTextForPlayer(playerid,"~r~Derby",2500,3);
		}
   	return 1;
	}
2-The car of that derby is always invisivel.O within normal loads so that the car is invisible, how do I fix this?


Re: 2 doubts - NewTorran - 18.06.2010

pawn Код:
new derby[MAX_PLAYERS];

//When player enters derby
derby[playerid] = 1;

//OnPlayerExitVehicle
if(derby[playerid] == 1) return SetPlayerHealth(playerid, 0), derby[playerid] = 0;
I think, If not tell me


Re: 2 doubts - Hiddos - 18.06.2010

2-LinkVehicleToInterior.

If you're using virtual worlds as well, SetVehicleVirtualWorld (Unconfirmed if this is the actual native function)


Re: 2 doubts - Mike Garber - 18.06.2010

Quote:
Originally Posted by Hiddos
2-LinkVehicleToInterior.

If you're using virtual worlds as well, SetVehicleVirtualWorld (Unconfirmed if this is the actual native function)
It is;
https://sampwiki.blast.hk/wiki/SetVehicleVirtualWorld


Re: 2 doubts - keller012 - 18.06.2010

the problem is not virtual world.
when I type / setInt 0 (I use to set indoor)
the car appears, so that the map some ...