Jump to content
  • 0

Problema verificare


Gawitkkk

Question

Problema intalnita (descriere): Nu face bine verificarea. Am facut un sistem de sechestrare a masinilor personale, dupa ce sunt sechestrate, sunt puse automat niste restrictii pe masina respectiva. Atunci cand intru in masina, nu face bine verificarea, ceea ce duce la neafisarea unor lucruri. 
Ero(area / rile) / warning-(ul / urile): -
Liniile de cod / sursa / script-ul(obligatoriu):

new carid = GetPlayerVehicleID(playerid);
                    if(CarInfo[carid][cSequester] > 0)
                    {
                        new fstring[1024];
                         strcat(fstring,"This vehicle is sequestered !");
                          strcat(fstring, "Owner: %s",CarInfo[OwnedVeh(newcar)][cOwner]);
                          strcat(fstring, "Model: %s",CarInfo[OwnedVeh(newcar)][cModel]);
                          strcat(fstring, "Sequestered by: %s",CarInfo[OwnedVeh(newcar)][cSequesterName]);
                          strcat(fstring, "Reason: %s",CarInfo[OwnedVeh(newcar)][cSequesterReason]);
                          strcat(fstring, "Cost: $%d",CarInfo[OwnedVeh(newcar)][cSequesterPrice]);
                          ShowPlayerDialog(playerid, DIALOG_TOW2, DIALOG_STYLE_MSGBOX, "Vehicle checking",fstring,"Pay","Cancel");
                          return 1;
                    }

Imagini / Video (optional): -
Ati incercat sa rezolvati singur?: Da.
Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

Este un fel de sistem de lock? Adica nu trebuia sa adaugi si restrictia de a se urca in masina?

Gen la publicul onplayerentervehicle

If psequestred>1

TogglePlayerControllable 1

?

 

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0
1 hour ago, Mister said:

Este un fel de sistem de lock? Adica nu trebuia sa adaugi si restrictia de a se urca in masina?

Gen la publicul onplayerentervehicle

If psequestred>1

TogglePlayerControllable 1

?

 

Momentan să facă verificarea şi să apară acel dialog, după care voi face şi restricţia respectivă cu TogglePlayerControllable...

Link to comment
Share on other sites

  • 0

incearca asa

      

      new fstring[1024];
	                         format(fstring,sizeof(fstring),"This vehicle is sequestered\
																Owner: %s\
								    	                      	Model: %s\
							    	                      		Sequestered by: %s\
								                          		Reason: %s\
								                          		Cost: $%d"
	                     		,CarInfo[OwnedVeh(newcar)][cOwner],
								CarInfo[OwnedVeh(newcar)][cModel],
								CarInfo[OwnedVeh(newcar)][cSequesterName],
								CarInfo[OwnedVeh(newcar)][cSequesterReason],
								CarInfo[OwnedVeh(newcar)][cSequesterPrice]);
		   ShowPlayerDialog(playerid, DIALOG_TOW2, DIALOG_STYLE_MSGBOX, "Vehicle checking",fstring,"Pay","Cancel");

 

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0
10 hours ago, Mister said:

incearca asa

      


      new fstring[1024];
	                         format(fstring,sizeof(fstring),"This vehicle is sequestered\
																Owner: %s\
								    	                      	Model: %s\
							    	                      		Sequestered by: %s\
								                          		Reason: %s\
								                          		Cost: $%d"
	                     		,CarInfo[OwnedVeh(newcar)][cOwner],
								CarInfo[OwnedVeh(newcar)][cModel],
								CarInfo[OwnedVeh(newcar)][cSequesterName],
								CarInfo[OwnedVeh(newcar)][cSequesterReason],
								CarInfo[OwnedVeh(newcar)][cSequesterPrice]);
		   ShowPlayerDialog(playerid, DIALOG_TOW2, DIALOG_STYLE_MSGBOX, "Vehicle checking",fstring,"Pay","Cancel");

 

Am facut cum ai spus tu, uite cum arata noile linii

 

if(IsAnOwnableCar(newcar))
        {
            if(CarInfo[OwnedVeh(newcar)][cSequester] == 1)
            {
                if(CarInfo[OwnedVeh(newcar)][cInsurancecar] > 0)
                {
                    if(personalcar[playerid] == newcar)
                    {
                           new fstring[1024],
                           idd = Findcar();
                        format(fstring,sizeof(fstring),"This vehicle is sequestered!\n\nOwner: %s\nModel: %s\nSequestered by: %s\nReason: %s\nCost: $%d"
                          ,CarInfo[OwnedVeh(newcar)][cOwner],
                        CarInfo[OwnedVeh(idd)][cDescription],
                        CarInfo[OwnedVeh(newcar)][cSequesterName],
                        CarInfo[OwnedVeh(newcar)][cSequesterReason],
                        CarInfo[OwnedVeh(newcar)][cSequesterPrice]);
                           ShowPlayerDialog(playerid, DIALOG_TOW2, DIALOG_STYLE_MSGBOX, "Vehicle checking",fstring,"Pay","Cancel");
                         }
                         else
                         {
                        RemovePlayerFromVehicleEx(playerid);
                        //SendClientMessage(playerid, COLOR_WHITE, "{FFB870}Can't drive this car until the owner pay the sequester ticket.");
                         }
                         return 1;
                     }
            }
        }


 

Problema urmatoare este:

 

- In dialog, nu imi apare numele masinii, uite aici o poza: JfX4Qyx.png

Link to comment
Share on other sites

  • 0

Asta e problema de la tine 

Variabila cModel nu aisetat o bine, 

Ea normal ar trebui sa fie de tip numar 

Arata-mi cum ai definito

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.