Problem add cars to server
#1

I have added some cars to my server, but when i try to take one car i can"t get in it, like the vehicle is locked.
PHP код:
public OnGameModeInit()
{
AddStaticVehicle(462,1760.8448,-1864.3921,13.1735,1.6483,2,1);
AddStaticVehicle(462,1762.8284,-1864.5500,13.1727,2.6849,2,1);
AddStaticVehicle(462,1764.8895,-1864.0648,13.1736,0.9902,2,1);
AddStaticVehicle(462,1767.1615,-1864.0217,13.1705,359.3277,2,1);
AddStaticVehicle(462,1769.3186,-1863.9844,13.1738,0.6843,2,1);
AddStaticVehicle(462,1772.1229,-1863.8629,13.1735,357.9254,2,1);
AddStaticVehicle(462,1775.2418,-1863.9003,13.1705,1.6564,2,1); 
Reply
#2

Please show us OnVehicleSpawn , maybe you locked it there
Reply
#3

Код:
public OnVehicleSpawn(vehicleid)
{
  if(vehicleid == tcccar){
  	ChangeVehiclePaintjob(tcccar,0); // paint job
  	AddVehicleComponent(tcccar, 1033); // roof
  	AddVehicleComponent(tcccar, 1010); // nos
  	AddVehicleComponent(tcccar, 1080); // rim
  	AddVehicleComponent(tcccar, 1029); // exhaust
  	AddVehicleComponent(tcccar, 1026); // side
  	AddVehicleComponent(tcccar, 1170); // front
  	AddVehicleComponent(tcccar, 1140); // rear
  	AddVehicleComponent(tcccar, 1139); // Spoiler
  }
    if(vehicleid == tcccar1){
  	ChangeVehiclePaintjob(tcccar1,0); // paint job
  	AddVehicleComponent(tcccar1, 1035); // roof
  	AddVehicleComponent(tcccar1, 1010); // nos
  	AddVehicleComponent(tcccar1, 1080); // rim
  	AddVehicleComponent(tcccar1, 1037); // exhaust
  	AddVehicleComponent(tcccar1, 1039); // side
  	AddVehicleComponent(tcccar1, 1172); // front
  	AddVehicleComponent(tcccar1, 1148); // back
  	AddVehicleComponent(tcccar1, 1146); // Spoiler
  }
      if(vehicleid == tcccar2){
  	ChangeVehiclePaintjob(tcccar2,0); // paint job
  	AddVehicleComponent(tcccar2, 1068); // roof
  	AddVehicleComponent(tcccar2, 1010); // nos
  	AddVehicleComponent(tcccar2, 1080); // rim
  	AddVehicleComponent(tcccar2, 1066); // exhaust
  	AddVehicleComponent(tcccar2, 1070); // side
  	AddVehicleComponent(tcccar2, 1173); // front
  	AddVehicleComponent(tcccar2, 1161); // back
  	AddVehicleComponent(tcccar2, 1158); // Spoiler
  }
      if(vehicleid == tcccar3){
  	ChangeVehiclePaintjob(tcccar3,0); // paint job
  	AddVehicleComponent(tcccar3, 1053); // roof
  	AddVehicleComponent(tcccar3, 1010); // nos
  	AddVehicleComponent(tcccar3, 1080); // rim
  	AddVehicleComponent(tcccar3, 1045); // exhaust
  	AddVehicleComponent(tcccar3, 1048); // side
  	AddVehicleComponent(tcccar3, 1152); // front
  	AddVehicleComponent(tcccar3, 1151); // back
  	AddVehicleComponent(tcccar3, 1050); // Spoiler
  }
      if(vehicleid == tcccar4){
  	ChangeVehiclePaintjob(tcccar4,0); // paint job
  	AddVehicleComponent(tcccar4, 1061); // roof
  	AddVehicleComponent(tcccar4, 1010); // nos
  	AddVehicleComponent(tcccar4, 1080); // rim
  	AddVehicleComponent(tcccar4, 1059); // exhaust
  	AddVehicleComponent(tcccar4, 1057); // side
  	AddVehicleComponent(tcccar4, 1156); // front
  	AddVehicleComponent(tcccar4, 1157); // back
  	AddVehicleComponent(tcccar4, 1060); // Spoiler
  }
      if(vehicleid == tcccar5){
  	ChangeVehiclePaintjob(tcccar5,0); // paint job
  	AddVehicleComponent(tcccar5, 1091); // roof
  	AddVehicleComponent(tcccar5, 1010); // nos
  	AddVehicleComponent(tcccar5, 1080); // rim
  	AddVehicleComponent(tcccar5, 1089); // exhaust
  	AddVehicleComponent(tcccar5, 1057); // side
  	AddVehicleComponent(tcccar5, 1165); // front
  	AddVehicleComponent(tcccar5, 1167); // back
  	AddVehicleComponent(tcccar5, 1163); // Spoiler
  }
  return 1;
}
Reply
#4

Show OnPlayerEnterVehicle
Reply
#5

Are you using SetVehicleParamsEx and/or SetVehicleParamsForPlayer functions at all?
Reply
#6

Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(gTeam[playerid] >= 1||gTeam[playerid] >= 3||gTeam[playerid] >= 4)
	{
		if (IsNgCar(vehicleid) && !ispassenger)
		{
		    if(PlayerInfo[playerid][pLeader]==1||PlayerInfo[playerid][pLeader]==2||PlayerInfo[playerid][pLeader]==3||PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pMember]==3) {}
		    else {
				//WantedPoints[playerid]+=2;
				//SetPlayerCriminal(playerid,255, "Stealing A Police Vehicle");
				new Float:cx, Float:cy, Float:cz;
				GetPlayerPos(playerid, cx, cy, cz);
				SetPlayerPos(playerid, cx,  cy, cz);
			}
		}
		if (IsAnAmbulance(vehicleid) && !ispassenger)
		{
		    if(PlayerInfo[playerid][pMember]==4||PlayerInfo[playerid][pLeader]==4) { }
		    else { WantedPoints[playerid]+=2; SetPlayerCriminal(playerid,255, "Stealing An Ambulance"); }
		}
		if (IsATank(vehicleid) && !ispassenger)
		{
			if(PlayerInfo[playerid][pLeader]==1||PlayerInfo[playerid][pLeader]==3||PlayerInfo[playerid][pMember]==3) {}
		    else { WantedPoints[playerid]+=2; SetPlayerCriminal(playerid,255, "Stealing A Tank"); SendClientMessage(playerid, COLOR_GREY,"You don't know how to drive it yet."); }
		}
		if(IsAnOwnableCar(vehicleid) && CarInfo[vehicleid][cLock] == 1 && CarInfo[vehicleid][cOwned] == 1)
		{
		    if(PlayerInfo[playerid][pAdmin] >= 5 && AdminDuty[playerid] == 1) { }
		    else
		    {
		    	new Float:cx, Float:cy, Float:cz;
		    	GetPlayerPos(playerid, cx, cy, cz);
		    	SetPlayerPos(playerid, cx, cy, cz);
			}
		}
	}
	return 1;
Reply
#7

Using your own script would help, instead of using a downloaded one or even worse, a leaked one.
Reply
#8

Solved!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)