GTA Közösség - A magyar GTA fórum

San Andreas Multiplayer (SA-MP) => SA-MP: Szerverfejlesztés => Segítségkérés => A témát indította: Devil112 - 2012. június 09. - 10:14:22

Cím: Saját autó spawn
Írta: Devil112 - 2012. június 09. - 10:14:22
Sziasztok.
Miért van az hogy folyton ha kiszállok a saját autómbol lespawnol oda?
Cím: Saját autó spawn
Írta: Norby - 2012. június 09. - 10:19:59
Mert lementi a koordinátákat és újra spawnolja a lementett koordinátákkal.
Általában RP szervereken szokott ilyen lenni.
Cím: Saját autó spawn
Írta: Devil112 - 2012. június 09. - 10:22:30
És nem lehet kiszedni?
Elég zavaró hogy kiszállok és a fejem fölé megy a kocsi.
Meg ott marad. :S
Cím: Saját autó spawn
Írta: Norby - 2012. június 09. - 10:23:36
Másold be az OnPlayerExitVehicle eljárást.
Cím: Saját autó spawn
Írta: Devil112 - 2012. június 09. - 10:28:41
public OnPlayerExitVehicle(playerid, vehicleid)
Cím: Saját autó spawn
Írta: Norby - 2012. június 09. - 11:24:35
Idézetet írta: Devil112 date=1339230521\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"22594\" data-ipsquote-contentclass=\"forums_Topic
public OnPlayerExitVehicle(playerid, vehicleid)
 
De ne csak ezt az egy sort... :D
Ami alatta van.
Cím: Saját autó spawn
Írta: Erik3333 - 2012. június 09. - 11:27:09
Idézetet írta: Norby date=1339233875\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"22594\" data-ipsquote-contentclass=\"forums_Topic


public OnPlayerExitVehicle(playerid, vehicleid)
 
De ne csak ezt az egy sort... :D
Ami alatta van.
 
[/quote]
Ezzel is vigyázni kell, mert nem lehet tudni, hogy csak az eljárást másolja be, vagy mindent, ami alatta van.
{ ettõl } eddig másold be.
Cím: Saját autó spawn
Írta: Devil112 - 2012. június 09. - 11:47:53

public OnPlayerExitVehicle(playerid, vehicleid)
{
    if(vehicleid >= 131 && vehicleid <= 134) // vizsgakocsi
{
Msg(playerid,\"[Oktató]: Kiszállt a kocsiból, így megbukott a vizsgán\");
DrivingStep[playerid] = 0;
TakingForgalmi[playerid] = 0;
TakingRutin[playerid] = 0;
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
DisablePlayerRaceCheckpoint(playerid);
}
if (GetPlayerState(playerid) == 1)
{
return 1;
}
new playerState = GetPlayerState(playerid);
    if (playerState == PLAYER_STATE_DRIVER)
    {
if(IsAnOwnableCar(vehicleid))
{
   if(vehicleid == PlayerInfo[playerid][pPcarkey] || vehicleid == PlayerInfo[playerid][pPcarkey2] || vehicleid == PlayerInfo[playerid][kolcsonkocsikulcs])
   {
         /*new Float:x,Float:y,Float:z;
      new Float:a;
      GetVehiclePos(vehicleid, x, y, z);
      GetVehicleZAngle(vehicleid, a);
      CarInfo[vehicleid][cLocationx] = x;
      CarInfo[vehicleid][cLocationy] = y;
      CarInfo[vehicleid][cLocationz] = z;
      CarInfo[vehicleid][cAngle] = a;
      //SetVehiclePos(vehicleid, x, y, z+2);
      //SetVehicleZAngle(vehicleid, a);
      //OnPropUpdate();*/
      new Float:health;
      new Float:x,Float:y,Float:z;
      new Float:a;
      new carid;
      carid = GetPlayerVehicleID(playerid);
      GetVehicleHealth(carid, health);
      GetVehiclePos(carid, x, y, z);
      GetPlayerFacingAngle(playerid, a);
      GetVehicleZAngle(carid, a);
      CarInfo[carid][cLocationx] = x;
      CarInfo[carid][cLocationy] = y;
      CarInfo[carid][cLocationz] = z;
      CarInfo[carid][cAngle] = a;
      SaveCarCoords();
      OnPlayerUpdate(playerid);
       DestroyVehicle(carid);
       CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy]+1.0,CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],-1);
        SetVehicleHealth(carid, health);
        new string[20];
      format(string, sizeof(string), \"ALR-%d\", carid);
       SetVehicleNumberPlate(carid, string);
        AddVehicleComponent(carid,CarInfo[carid][cKerek]);
      ChangeVehiclePaintjob(carid, CarInfo[carid][cPaintjob]-1);
      AddVehicleComponent(carid,CarInfo[carid][cKinezet1]);
      AddVehicleComponent(carid,CarInfo[carid][cKinezet2]);
      AddVehicleComponent(carid,CarInfo[carid][cKinezet3]);
      AddVehicleComponent(carid,CarInfo[carid][cKinezet4]);
      AddVehicleComponent(carid,CarInfo[carid][cKinezet5]);
      AddVehicleComponent(carid,CarInfo[carid][cKinezet6]);
      AddVehicleComponent(carid,CarInfo[carid][cKinezet7]);
      AddVehicleComponent(carid,CarInfo[carid][cKinezet8]);
      AddVehicleComponent(carid,CarInfo[carid][cKinezet9]);
      AddVehicleComponent(carid,CarInfo[carid][cKinezet10]);
      AddVehicleComponent(carid,CarInfo[carid][cNitro]);
      AddVehicleComponent(carid,CarInfo[carid][cHidraulika]);
             }
}
}
Cím: Saját autó spawn
Írta: Norby - 2012. június 09. - 12:26:10
public OnPlayerExitVehicle(playerid, vehicleid)
{
    if(vehicleid >= 131 && vehicleid <= 134) // vizsgakocsi
{
Msg(playerid,\"[Oktató]: Kiszállt a kocsiból, így megbukott a vizsgán\");
DrivingStep[playerid] = 0;
TakingForgalmi[playerid] = 0;
TakingRutin[playerid] = 0;
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
DisablePlayerRaceCheckpoint(playerid);
  }
if (GetPlayerState(playerid) == 1)
{
return 1;
}
  new playerState = GetPlayerState(playerid);
    if (playerState == PLAYER_STATE_DRIVER)
    {
if(IsAnOwnableCar(vehicleid))
{
if(vehicleid == PlayerInfo[playerid][pPcarkey] || vehicleid == PlayerInfo[playerid][pPcarkey2] || vehicleid == PlayerInfo[playerid][kolcsonkocsikulcs])
{
    /*new Float:x,Float:y,Float:z;
new Float:a;
GetVehiclePos(vehicleid, x, y, z);
GetVehicleZAngle(vehicleid, a);
CarInfo[vehicleid][cLocationx] = x;
CarInfo[vehicleid][cLocationy] = y;
CarInfo[vehicleid][cLocationz] = z;
CarInfo[vehicleid][cAngle] = a;
//SetVehiclePos(vehicleid, x, y, z+2);
//SetVehicleZAngle(vehicleid, a);
//OnPropUpdate();*/
new Float:health;
new Float:x,Float:y,Float:z;
new Float:a;
new carid;
carid = GetPlayerVehicleID(playerid);
GetVehicleHealth(carid, health);
GetVehiclePos(carid, x, y, z);
GetPlayerFacingAngle(playerid, a);
GetVehicleZAngle(carid, a);
CarInfo[carid][cLocationx] = x;
CarInfo[carid][cLocationy] = y;
CarInfo[carid][cLocationz] = z;
CarInfo[carid][cAngle] = a;
SaveCarCoords();
OnPlayerUpdate(playerid);
        SetVehicleHealth(carid, health);
        new string[20];
format(string, sizeof(string), \"ALR-%d\", carid);
    SetVehicleNumberPlate(carid, string);
        AddVehicleComponent(carid,CarInfo[carid][cKerek]);
ChangeVehiclePaintjob(carid, CarInfo[carid][cPaintjob]-1);
AddVehicleComponent(carid,CarInfo[carid][cKinezet1]);
AddVehicleComponent(carid,CarInfo[carid][cKinezet2]);
AddVehicleComponent(carid,CarInfo[carid][cKinezet3]);
AddVehicleComponent(carid,CarInfo[carid][cKinezet4]);
AddVehicleComponent(carid,CarInfo[carid][cKinezet5]);
AddVehicleComponent(carid,CarInfo[carid][cKinezet6]);
AddVehicleComponent(carid,CarInfo[carid][cKinezet7]);
AddVehicleComponent(carid,CarInfo[carid][cKinezet8]);
AddVehicleComponent(carid,CarInfo[carid][cKinezet9]);
AddVehicleComponent(carid,CarInfo[carid][cKinezet10]);
AddVehicleComponent(carid,CarInfo[carid][cNitro]);
AddVehicleComponent(carid,CarInfo[carid][cHidraulika]);
        }
}
}
Cím: Saját autó spawn
Írta: Devil112 - 2012. június 09. - 20:59:09
Warningos az egész :S