[Pomoc]Ne sacuva poziciju

Započeo davax, Januar 01, 2014, 04:31:03 PRE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

Skripta koju koristim:NY:RP
Detaljan opis problema: Stavim da se auto parkira  i kad  respawnam aute on je opet tamo gdje sam ga kupio  -- znaci ne sacuva poziciju
Dio skripte:Recite sta treba
Neke slike/video za lakse dobivanje pomoci(neobavezno):??
YCMD:v(playerid, params[],help)
{
        #pragma unused help
        #pragma unused params
        if(P_Data[playerid][Vozilo1] == 999) return SCM(playerid,COLOR_RED,"[Greska]: "COL_WHITE"Ne posjedujete vozilo!");
        ShowPlayerDialog(playerid,DIALOG_CARS,DIALOG_STYLE_LIST,"Vehicle control panel","Boja\nZakljucaj\nOtkljucaj\nProdaj\nParkiraj\nLociraj\nHauba\nGepek\nKilometri\nSpremanje novca\nUzimanje novca\nStanje","Izaberi","Odustani");
        CheckPlayer(playerid);
return 1;
}


case DIALOG_CARS://COS
    {
   new vehicleid = GetPlayerVehicleID(playerid);
   new Float:X, Float:Y, Float:Z; GetVehiclePos(vehicleid, X, Y, Z);
   if(!response) return SCM(playerid,-1,"Dialog iskljucen");
   switch(listitem)
   {
    case 0: {//Boja
      if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid,COLOR_RED,"[Greska]: "COL_WHITE"Morate biti u vozilu!");
    ShowPlayerDialog(playerid,DIALOG_CARS1,DIALOG_STYLE_INPUT,"Boja","Cijena: $200\nKucajte ID boja.\n Primjer: 5","Promjeni","Odustani"); }
    case 1: {//Zakljucavanje
    new vehicle = GetClosestVehicle(playerid);
    GetVehiclePos(vehicle, X, Y, Z);
if(!IsPlayerInRangeOfPoint(playerid, 3.0, X, Y, Z)) return SCM(playerid,COLOR_RED,"[Greska]: "COL_WHITE"Niste blizu vozila!");
            if(P_Data[playerid][Vozilo1] != vehicle) return SCM(playerid,COLOR_RED,"[Greska]: "COL_WHITE"Ovo nije vase vozilo!");
if(P_Data[playerid][Vozilo1] != 999) {C_Data[playerid][Lock1] = 1; SetVehicleParamsEx(vehicle,engine,lights,alarm,1,bonnet,boot,objective); SCM(playerid,COLOR_WHITE,"Zakljucali ste vozilo!"); CheckCar(GetName(playerid),playerid);}}
    case 2: {//Otkljucavanje
    new vehicle = GetClosestVehicle(playerid);
    GetVehiclePos(vehicle, X, Y, Z);
if(!IsPlayerInRangeOfPoint(playerid, 3.0, X, Y, Z)) return SCM(playerid,COLOR_RED,"[Greska]: "COL_WHITE"Niste blizu vozila!");
            if(P_Data[playerid][Vozilo1] != vehicle) return SCM(playerid,COLOR_RED,"[Greska]: "COL_WHITE"Ovo nije vase vozilo!");
if(P_Data[playerid][Vozilo1] != 999) {C_Data[playerid][Lock1] = 0; SetVehicleParamsEx(vehicle,engine,lights,alarm,0,bonnet,boot,objective); SCM(playerid,COLOR_WHITE,"Otkljucali ste vozilo!"); CheckCar(GetName(playerid),playerid);}}
    case 3: {
    new price = GetVehiclePrice(GetVehicleModel(vehicleid));
        if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid,COLOR_RED,"[Greska]: "COL_WHITE"Morate biti u vozilu!");
if(P_Data[playerid][Vozilo1] == vehicleid) {
    /*C_Data[playerid][cX1] = 0;
    C_Data[playerid][cY1] = 0;
    C_Data[playerid][cZ1] = 0;
    C_Data[playerid][Model1] = 0;
    C_Data[playerid][Kilometri1] = 0;
    format(C_Data[playerid][Owner1],128,"Department");
    CheckCar(GetName(playerid),playerid);*/
    P_Data[playerid][Vozilo1] = 999;
JBC_GivePlayerMoney(playerid, price/2);
SendFormatMSG(playerid,-1,"Prodali ste vozilo po ceni $%d",price/2);
DestroyVehicle(vehicleid);
ObrisiVozilo(GetName(playerid));
CheckPlayer(playerid); }}
case 4: {
new Float:Pos[4]; GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]); GetVehicleZAngle(vehicleid, Pos[3]);
    if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid,COLOR_RED,"[Greska]: "COL_WHITE"Morate biti u vozilu!");
if(P_Data[playerid][Vozilo1] == vehicleid)
{
        C_Data[playerid][cX1] = Pos[0];
        C_Data[playerid][cY1] = Pos[1];
        C_Data[playerid][cZ1] = Pos[2];
        C_Data[playerid][cA1] = Pos[3];
JBC_SetVehiclePos(vehicleid, C_Data[playerid][cX1],C_Data[playerid][cY1],C_Data[playerid][cZ1]);
SetVehicleZAngle(vehicleid, C_Data[playerid][cA1]);
CheckCar(GetName(playerid),playerid);
SCM(playerid,-1,"Vozilo je parkirano.");
CheckPlayer(playerid);
}
}
    case 5: {//Lociranje
            if(P_Data[playerid][Vozilo1] != 999) { GPSOn[playerid] = true; GetVehiclePos(P_Data[playerid][Vozilo1],X, Y, Z); SetPlayerCheckpoint(playerid,X, Y, Z,5.0); SCM(playerid, COLOR_WHITE, "Vase vozilo je locirano.");} }
        case 6: {//Hauba
            ShowPlayerDialog(playerid,DIALOG_CARS8,DIALOG_STYLE_LIST,"Vozilo 1","Otvori\nZatvori","Odaberi","Odustani"); }
        case 7: {//Gepek
            ShowPlayerDialog(playerid,DIALOG_CARS10,DIALOG_STYLE_LIST,"Vozilo 1","Otvori\nZatvori","Odaberi","Odustani"); }
    case 8: {//Kilometri
    if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid,COLOR_RED,"[Greska]: "COL_WHITE"Morate biti u vozilu!");
    if(P_Data[playerid][Vozilo1] != vehicleid) return SCM(playerid,COLOR_RED,"[Greska]: "COL_WHITE"Ovo nije vase vozilo!");
            if(P_Data[playerid][Vozilo1] != 999) {SendFormatMSG(playerid,-1,"Vase vozilo ima %d kilometara.",C_Data[playerid][Kilometri1]);}}
    case 9: {//Stavljanje novca u vozilo
            ShowPlayerDialog(playerid,DIALOG_CARS2,DIALOG_STYLE_INPUT,"Vozilo 1","Unesite koliko zelite novca spremit u vozilo:","Odaberi","Odustani"); }
    case 10: {//Uzimanje novca iz vozila
            ShowPlayerDialog(playerid,DIALOG_CARS3,DIALOG_STYLE_INPUT,"Vozilo 1","Unesite koliko zelite novca uzet iz vozila:","Odaberi","Odustani"); }
    case 11: {//Stanje
    new string[256];
    format(string,sizeof(string),""COL_GREEN"Oruzje1: "COL_WHITE"%d"COL_GREEN", metci1: "COL_WHITE"%d\n"COL_GREEN"Oruzje2: "COL_WHITE"%d"COL_GREEN", metci2: "COL_WHITE"%d\n"COL_GREEN"Novac: "COL_WHITE"$%d\n"COL_GREEN"Tablice: "COL_WHITE"%s",C_Data[playerid][Gun11],C_Data[playerid][Ammo11],C_Data[playerid][Gun21],C_Data[playerid][Ammo21],C_Data[playerid][Money1],C_Data[playerid][Tablica1]);
            ShowPlayerDialog(playerid,DIALOG_CARS4,DIALOG_STYLE_MSGBOX,"Vozilo 1",string,"Uredu",""); }
   }
    }
case DIALOG_CARS1://Boja
{
new vehicleid = GetPlayerVehicleID(playerid),col[2];
if(strval(inputtext) < 0 || strval(inputtext) > 255) return SCM(playerid, COLOR_RED, "[Greska]: "COL_WHITE"Nemozete ispod 0 i preko 255 boje!");
if(sscanf(inputtext,"ii",col[0],col[1])) return ShowPlayerDialog(playerid,DIALOG_CARS,DIALOG_STYLE_INPUT,"Boja","Cijena: $200\nKucajte ID boja.\n Primjer: 5 9","Promjeni","Odustani");
if(P_Data[playerid][Vozilo1] == vehicleid)
{
C_Data[playerid][Col11] = col[0];
C_Data[playerid][Col21] = col[1];
CheckCar(GetName(playerid),playerid);
}
JBC_GivePlayerMoney(playerid,-200);
ChangeVehicleColor(vehicleid,col[0],col[1]);
}
case DIALOG_CARS2://Stavljanje novca u vozilo
{
        new id = GetPlayerVehicleID(playerid),Float:X, Float:Y, Float:Z;
GetVehiclePos(P_Data[playerid][Vozilo1], X, Y, Z);
        if(P_Data[playerid][Vozilo1] == 999) return SCM(playerid,COLOR_RED,"[Greska]: "COL_WHITE"Vi ne posedujete vozilo!");
        if(P_Data[playerid][Vozilo1] == id)
        {
if(!IsPlayerInRangeOfPoint(playerid,3.0,X, Y, Z)) return SCM(playerid,COLOR_RED,"[Greska]: "COL_WHITE"Niste blizu svog vozila");
if(strval(inputtext) > JBC_GetPlayerMoney(playerid)) return SCM(playerid, COLOR_RED, "[Greska]: "COL_WHITE"Nemate toliko novca!");
if(strval(inputtext) < 1) return SCM(playerid, COLOR_RED, "[Greska]: "COL_WHITE"Novac ne smije biti manji od 1!");
        JBC_GivePlayerMoney(playerid, -strval(inputtext));
        SendFormatMSG(playerid,-1,"Stavili ste u vozilo $%d",strval(inputtext));
C_Data[playerid][Money1] += strval(inputtext);
CheckCar(GetName(playerid),playerid);
        }
        CheckPlayer(playerid);
}
case DIALOG_CARS3://Uzimanje novca iz vozila
{
        new id = GetPlayerVehicleID(playerid),Float:X, Float:Y, Float:Z;
GetVehiclePos(P_Data[playerid][Vozilo1], X, Y, Z);
        if(P_Data[playerid][Vozilo1] == 999) return SCM(playerid,COLOR_RED,"[Greska]: "COL_WHITE"Vi ne posedujete vozilo!");
        if(P_Data[playerid][Vozilo1] == id)
        {
if(!IsPlayerInRangeOfPoint(playerid,3.0,X, Y, Z)) return SCM(playerid,COLOR_RED,"[Greska]: "COL_WHITE"Niste blizu svog vozila");
if(strval(inputtext) > C_Data[playerid][Money1]) return SCM(playerid, COLOR_RED, "[Greska]: "COL_WHITE"Nemate toliko novca u vozilu!");
if(strval(inputtext) < 1) return SCM(playerid, COLOR_RED, "[Greska]: "COL_WHITE"Novac ne smije biti manji od 1!");
        JBC_GivePlayerMoney(playerid, strval(inputtext));
        SendFormatMSG(playerid,-1,"Stavili ste u vozilo $%d",strval(inputtext));
C_Data[playerid][Money1] -= strval(inputtext);
CheckCar(GetName(playerid),playerid);
        }
        CheckPlayer(playerid);
}
    case DIALOG_CARS8://Hauba
    {
       new Float:X, Float:Y, Float:Z,vehicleid = GetClosestVehicle(playerid);
       GetVehiclePos(vehicleid, X, Y, Z);
   switch(listitem)
   {
    case 0: {
if(!IsPlayerInRangeOfPoint(playerid, 3.0, X, Y, Z)) return SCM(playerid,COLOR_RED,"[Greska]: "COL_WHITE"Niste blizu vozila!");
if(P_Data[playerid][Vozilo1] != 999) {C_Data[playerid][Hauba1] = 1; SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,1,boot,objective); SCM(playerid,COLOR_WHITE,"Otvorili ste haubu!"); CheckCar(GetName(playerid),playerid);}}
          case 1: {
if(!IsPlayerInRangeOfPoint(playerid, 3.0, X, Y, Z)) return SCM(playerid,COLOR_RED,"[Greska]: "COL_WHITE"Niste blizu vozila!");
if(P_Data[playerid][Vozilo1] != 999) {C_Data[playerid][Hauba1] = 0; SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,0,boot,objective); SCM(playerid,COLOR_WHITE,"Zatvorili ste haubu!"); CheckCar(GetName(playerid),playerid);}}
           }
    }
    case DIALOG_CARS10://Gepek
    {
       new Float:X, Float:Y, Float:Z,vehicleid = GetClosestVehicle(playerid);
       GetVehiclePos(vehicleid, X, Y, Z);
   switch(listitem)
   {
    case 0: {
if(!IsPlayerInRangeOfPoint(playerid, 3.0, X, Y, Z)) return SCM(playerid,COLOR_RED,"[Greska]: "COL_WHITE"Niste blizu vozila!");
            if(P_Data[playerid][Vozilo1] != 999) {C_Data[playerid][Gepek1] = 1; SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,1,objective); SCM(playerid,COLOR_WHITE,"Otvorili ste gepek!"); CheckCar(GetName(playerid),playerid);}}
    case 1: {
    if(!IsPlayerInRangeOfPoint(playerid, 3.0, X, Y, Z)) return SCM(playerid,COLOR_RED,"[Greska]: "COL_WHITE"Niste blizu vozila!");
            if(P_Data[playerid][Vozilo1] != 999) {C_Data[playerid][Gepek1] = 0; SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,0,objective); SCM(playerid,COLOR_WHITE,"Zatvorili ste gepek!"); CheckCar(GetName(playerid),playerid);}}
           }
    }
    case 19213:
    {
            if(!response) return SCM(playerid,-1,"Dialog iskljucen");
switch(listitem)
{
case 0:
{
   new string[128];
   format(string,128,"{1B8EE0}Radna knjizica: {FFFFFF}$%d",P_Data[playerid][RadnaKnjizica]);
   SCM(playerid,-1,string);
}
case 1:
{
   ShowPlayerDialog(playerid,19214,DIALOG_STYLE_INPUT,"{1B8EE0}Novac","{FFFFFF}Unesite sumu koju podizete","Podigni","Odustani"); }
}
    }


recite sta treba
Poslednja Izmena: Januar 01, 2014, 04:31:31 PRE PODNE od davax



                                                               BUMP