Jump to content
  • 0

Puncte asigurare masina


alexandruo9

Question

Problema intalnita (descriere): Vreau sa pot da maxim 10 puncte de asigurare ca acum pot da infinit!! Mai ales cand iti cumperi masina iti da 10/10 puncte de asigurare dar poti cumpara cu 0$ un infinit!! Si trece de 10/10 si o sa de vina 99999999/10 !! de exemplu merge un jucator la dealership isi cumpara o masina si cand intra in ea spune ca are 10/10 insurance points s-au puncte asigurare dar daca vrea sa isi mai cumpere poate sa cumpere cate doreste cu 0$ cu m pot rezolva aceasta problema!!
Ero(area / rile) / warning-(ul / urile):Nam
Liniile de cod / sursa / script-ul(obligatoriu):
if(dialogid == 22521)
 	{
 	    if(response)
 	    {
 	        if(!isnull(inputtext))
 	        {
 	            new points = strval(inputtext);
	 	        if(playerVariables[playerid][pCarSelected] == 1)
	 	        {
					if(points > 0)
					{
					    new bani = playerVariables[playerid][pInsurance]*points;
					    if(playerVariables[playerid][pMoney] > bani)
					    {
							playerVariables[playerid][pInsurancePoints] += points;
		                    playerVariables[playerid][pMoney] -= bani;
		                    format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
		                    SCM(playerid,COLOR_ATTACK, szMessage);
		                }
		                else SCM(playerid, -1,"You don't have enought money.");
					}
	 	        }
	 	        else if(playerVariables[playerid][pCarSelected] == 2)
	 	        {
					if(points > 0)
					{
					    new bani = playerVariables[playerid][pInsurance2]*points;
					    if(playerVariables[playerid][pMoney] > bani)
					    {
							playerVariables[playerid][pInsurancePoints2] += points;
		                    playerVariables[playerid][pMoney] -= bani;
		                    format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
		                    SCM(playerid,COLOR_ATTACK, szMessage);
		                }
		                else SCM(playerid, -1,"You don't have enought money.");
					}
	 	        }
	 	        else if(playerVariables[playerid][pCarSelected] == 3)
	 	        {
					if(points > 0)
					{
					    new bani = playerVariables[playerid][pInsurance3]*points;
					    if(playerVariables[playerid][pMoney] > bani)
					    {
							playerVariables[playerid][pInsurancePoints3] += points;
		                    playerVariables[playerid][pMoney] -= bani;
		                    format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
		                    SCM(playerid,COLOR_ATTACK, szMessage);
		                }
		                else SCM(playerid, -1,"You don't have enought money.");
					}
	 	        }
	 	        else if(playerVariables[playerid][pCarSelected] == 4)
	 	        {
					if(points > 0)
					{
					    new bani = playerVariables[playerid][pInsurance4]*points;
					    if(playerVariables[playerid][pMoney] > bani)
					    {
							playerVariables[playerid][pInsurancePoints4] += points;
		                    playerVariables[playerid][pMoney] -= bani;
		                    format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
		                    SCM(playerid,COLOR_ATTACK, szMessage);
		                }
		                else SCM(playerid, -1,"You don't have enought money.");
					}
	 	        }
	 	    }
 	    }
 	}

 

Imagini / Video (optional):Nu cred ca este necesar
Ati incercat sa rezolvati singur?:Am incercat dar nu imi dau seama!! ce trebuie sa schimb
Link to comment
Share on other sites

Recommended Posts

  • 0

Dupa new points = strval(inputtext); pune una din urmatoarele conditii:

if(playerVariables[playerid][pInsurance] > 10) return SCM(playerid,COLOR_ATTACK, "Ai maximul de puncte");
if(points > 10) return SCM(playerid,COLOR_ATTACK, "Nu poti pune mai mult de 10 puncte");

Iar in functia in care spawneaza masina personala playerului trebuie sa setezi

playerVariables[playerid][pInsurance] = 0;

in loc de 10.

qua8n0lrq5wl5v5xccbk.png
 
mf79y6bvavi9sp2qqfoi.png
Contact: Mail: [email protected]
Y!M: r3mus.onlypro
Skype: r3mus.onlypro
Link to comment
Share on other sites

  • 0

E bun dar tot poate sa cumpere peste 10 puncte asigurare acum marge nu are voie sa cumpere mai mult de 10 puncte dar poate sa dea 10 + 10 +10 etc...

Cum pot face sa se blocheze la 10 sa nu treaca peste 10 puncte!!

 

Mersi mult 

R3muSGFX o mers sfatul tau dar daca mai putea ajuta si cu blocare la 10 puncte ar fii perfect.
Link to comment
Share on other sites

  • 0

Ala e dialogul, dar ce comanda folosesti ca sa cumperi punctele ? Ca imi trebuie comanda, sau e un pickup si cand intri in el iti apare aia ?

Asta e comanda cu ajutorul caruia cumpar punctele de asigurare!!

CMD:cars(playerid, params[])
{
	new param4[32],param69[32],param59[32],param70[32];
	if(playerVariables[playerid][pCarModel1] >= 400)
	{
		format(param4, sizeof(param4), "%s (ID %d)", VehicleNames[playerVariables[playerid][pCarModel1] - 400], playerVariables[playerid][pCarID1]);
	}
	else
	{
		param4 = "Empty";
	}
	if(playerVariables[playerid][pCarModel2] >= 400)
	{
		format(param69, sizeof(param4), "%s (ID %d)", VehicleNames[playerVariables[playerid][pCarModel2] - 400], playerVariables[playerid][pCarID2]);
	}
	else
	{
		param69 = "Empty";
	}
	if(playerVariables[playerid][pCarModel3] >= 400)
	{
		format(param59, sizeof(param59), "%s (ID %d)", VehicleNames[playerVariables[playerid][pCarModel3] - 400], playerVariables[playerid][pCarID3]);
	}
	else
	{
		param59 = "Empty";
	}
	if(playerVariables[playerid][pCarModel4] >= 400)
	{
		format(param70, sizeof(param70), "%s (ID %d)", VehicleNames[playerVariables[playerid][pCarModel4] - 400], playerVariables[playerid][pCarID4]);
	}
	else
	{
		param70 = "Empty";
	}
	format(szMessage, sizeof(szMessage), "%sn%sn%sn%s",param4,param69,param59,param70);
	ShowPlayerDialog(playerid, 15524, DIALOG_STYLE_LIST, "Your personal cars", szMessage, "Select", "Cancel");
	return 1;
}

Si dialogul

	if(dialogid == 15524)
	{
		if(response)
		{
			new car = listitem+1;
			playerVariables[playerid][pCarSelected] = car;
			ShowPlayerDialog(playerid, 15520, DIALOG_STYLE_LIST, "Vehicle options", "Respawn carnLocate carnVehicle infonBuy insurance", "Ok", "Cancel");
		}
	}

Cred ca asta e tot daca crezi ca ai nevoie pun tot dialogu is cu resapwn etc!!!Multumesc ca incerci sa ma ajuti!!

Link to comment
Share on other sites

  • 0

Deci fi antena 1 :)) dupa

new points = strval(inputtext);

adauga asa : 

if(playerVariables[playerid][pInsurance] == 10)
{
    SendClientMessage(playerid, COLOR_ATTACK, "Ai deja 10 puncte de asigurare .");
    return 1;
}

Asta la dialog, la inceputul dialogului ... :D Asa am vrut sa-ti zic de prima data, dar banuiam ca , comanda e structurata altfel ...

Edited by NoNamed
  • Upvote 1
Link to comment
Share on other sites

  • 0

Deci fi antena 1 :)) dupa

new points = strval(inputtext);

adauga asa : 

if(playerVariables[playerid][pInsurance] == 10)
{
    SendClientMessage(playerid, COLOR_ATTACK, "Ai deja 10 puncte de asigurare .");
    return 1;
}

Asta la dialog, la inceputul dialogului ... :D Asa am vrut sa-ti zic de prima data, dar banuiam ca , comanda e structurata altfel ...

Nu merge tot pot sari de 10 de exemplu dau 10 + 8 ce trebuie sa fac am pus aia dar nu face nimic!!

if(dialogid == 22521)
 	{
 	    if(response)
 	    {
 	        if(!isnull(inputtext))
 	        {
 	            new points = strval(inputtext);
 	            if(playerVariables[playerid][pInsurance] == 10)
				{
				SendClientMessage(playerid, COLOR_ATTACK, "Ai deja 10 puncte de asigurare .");
				return 1;
				}
				if(points > 10) return SCM(playerid,COLOR_ATTACK, "Nu poti pune mai mult de 10 puncte");
	 	        if(playerVariables[playerid][pCarSelected] == 1)
	 	        {
					if(points > 0)
					{
					    new bani = playerVariables[playerid][pInsurance]*points;
					    if(playerVariables[playerid][pMoney] > bani)
					    {
							playerVariables[playerid][pInsurancePoints] += points;
		                    playerVariables[playerid][pMoney] -= bani;
		                    format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
		                    SCM(playerid,COLOR_ATTACK, szMessage);
		                }
		                else SCM(playerid, -1,"You don't have enought money.");
					}
	 	        }
	 	        else if(playerVariables[playerid][pCarSelected] == 2)
	 	        {
					if(points > 0)
					{
					    new bani = playerVariables[playerid][pInsurance2]*points;
					    if(playerVariables[playerid][pMoney] > bani)
					    {
							playerVariables[playerid][pInsurancePoints2] += points;
		                    playerVariables[playerid][pMoney] -= bani;
		                    format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
		                    SCM(playerid,COLOR_ATTACK, szMessage);
		                }
		                else SCM(playerid, -1,"You don't have enought money.");
					}
	 	        }
	 	        else if(playerVariables[playerid][pCarSelected] == 3)
	 	        {
					if(points > 0)
					{
					    new bani = playerVariables[playerid][pInsurance3]*points;
					    if(playerVariables[playerid][pMoney] > bani)
					    {
							playerVariables[playerid][pInsurancePoints3] += points;
		                    playerVariables[playerid][pMoney] -= bani;
		                    format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
		                    SCM(playerid,COLOR_ATTACK, szMessage);
		                }
		                else SCM(playerid, -1,"You don't have enought money.");
					}
	 	        }
	 	        else if(playerVariables[playerid][pCarSelected] == 4)
	 	        {
					if(points > 0)
					{
					    new bani = playerVariables[playerid][pInsurance4]*points;
					    if(playerVariables[playerid][pMoney] > bani)
					    {
							playerVariables[playerid][pInsurancePoints4] += points;
		                    playerVariables[playerid][pMoney] -= bani;
		                    format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
		                    SCM(playerid,COLOR_ATTACK, szMessage);
		                }
		                else SCM(playerid, -1,"You don't have enought money.");
					}
	 	        }
	 	    }
 	    }
 	}
	if(dialogid == 15524)
	{
		if(response)
		{
			new car = listitem+1;
			playerVariables[playerid][pCarSelected] = car;
			ShowPlayerDialog(playerid, 15520, DIALOG_STYLE_LIST, "Vehicle options", "Respawn carnLocate carnVehicle infonBuy insurance", "Ok", "Cancel");
		}
	}			
Link to comment
Share on other sites

  • 0

da asta e singurul!! 

Am pus asta asa si tot nu merge am gresit ceva?

	if(dialogid == 22521)
 	{
 	    if(response)
 	    {
 	        if(!isnull(inputtext))
 	        {
 	            new points = strval(inputtext);
				if(points > 10) return SCM(playerid,COLOR_ATTACK, "Nu poti pune mai mult de 10 puncte");
	 	        if(playerVariables[playerid][pCarSelected] == 1)
	 	        {
 	         		if(playerVariables[playerid][pInsurance] == 10)
 	        		{
					SendClientMessage(playerid, COLOR_ATTACK, "Ai deja 10 puncte de asigurare .");
					return 1;
					}
					if(points > 0)
					{
					    new bani = playerVariables[playerid][pInsurance]*points;
					    if(playerVariables[playerid][pMoney] > bani)
					    {
							playerVariables[playerid][pInsurancePoints] += points;
		                    playerVariables[playerid][pMoney] -= bani;
		                    format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
		                    SCM(playerid,COLOR_ATTACK, szMessage);
		                }
		                else SCM(playerid, -1,"You don't have enought money.");
					}
	 	        }
	 	        else if(playerVariables[playerid][pCarSelected] == 2)
	 	        {
       				if(playerVariables[playerid][pInsurance] == 10)
 	        		{
					SendClientMessage(playerid, COLOR_ATTACK, "Ai deja 10 puncte de asigurare .");
					return 1;
					}
					if(points > 0)
					{
					    new bani = playerVariables[playerid][pInsurance2]*points;
					    if(playerVariables[playerid][pMoney] > bani)
					    {
							playerVariables[playerid][pInsurancePoints2] += points;
		                    playerVariables[playerid][pMoney] -= bani;
		                    format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
		                    SCM(playerid,COLOR_ATTACK, szMessage);
		                }
		                else SCM(playerid, -1,"You don't have enought money.");
					}
	 	        }
	 	        else if(playerVariables[playerid][pCarSelected] == 3)
	 	        {
          			if(playerVariables[playerid][pInsurance] == 10)
 	        		{
					SendClientMessage(playerid, COLOR_ATTACK, "Ai deja 10 puncte de asigurare .");
					return 1;
					}
					if(points > 0)
					{
					    new bani = playerVariables[playerid][pInsurance3]*points;
					    if(playerVariables[playerid][pMoney] > bani)
					    {
							playerVariables[playerid][pInsurancePoints3] += points;
		                    playerVariables[playerid][pMoney] -= bani;
		                    format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
		                    SCM(playerid,COLOR_ATTACK, szMessage);
		                }
		                else SCM(playerid, -1,"You don't have enought money.");
					}
	 	        }
	 	        else if(playerVariables[playerid][pCarSelected] == 4)
	 	        {
          			if(playerVariables[playerid][pInsurance] == 10)
 	        		{
					SendClientMessage(playerid, COLOR_ATTACK, "Ai deja 10 puncte de asigurare .");
					return 1;
					}
					if(points > 0)
					{
					    new bani = playerVariables[playerid][pInsurance4]*points;
					    if(playerVariables[playerid][pMoney] > bani)
					    {
							playerVariables[playerid][pInsurancePoints4] += points;
		                    playerVariables[playerid][pMoney] -= bani;
		                    format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
		                    SCM(playerid,COLOR_ATTACK, szMessage);
		                }
		                else SCM(playerid, -1,"You don't have enought money.");
					}
	 	        }
	 	    }
 	    }
 	}
Edited by alexandruo9
Link to comment
Share on other sites

  • 0

Acum zice ca am 10 puncte de asigurare dar nu am nici una!!

if(dialogid == 22521)
 	{
 	    if(response)
 	    {
 	        if(!isnull(inputtext))
 	        {
 	            new points = strval(inputtext);
				if(points > 10) return SCM(playerid,COLOR_ATTACK, "Nu poti pune mai mult de 10 puncte");
	 	        if(playerVariables[playerid][pCarSelected] == 1)
	 	        {
				if(playerVariables[playerid][pInsurance] != 10)
 	        		{
					SendClientMessage(playerid, COLOR_ATTACK, "Ai deja 10 puncte de asigurare .");
					return 1;
					}
					if(points > 0)
					{
					    new bani = playerVariables[playerid][pInsurance]*points;
					    if(playerVariables[playerid][pMoney] > bani)
					    {
							playerVariables[playerid][pInsurancePoints] += points;
		                    playerVariables[playerid][pMoney] -= bani;
		                    format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
		                    SCM(playerid,COLOR_ATTACK, szMessage);
		                }
		                else SCM(playerid, -1,"You don't have enought money.");
					}
	 	        }
	 	        else if(playerVariables[playerid][pCarSelected] == 2)
	 	        {
       				if(playerVariables[playerid][pInsurance] != 10)
 	        		{
					SendClientMessage(playerid, COLOR_ATTACK, "Ai deja 10 puncte de asigurare .");
					return 1;
					}
					if(points > 0)
					{
					    new bani = playerVariables[playerid][pInsurance2]*points;
					    if(playerVariables[playerid][pMoney] > bani)
					    {
							playerVariables[playerid][pInsurancePoints2] += points;
		                    playerVariables[playerid][pMoney] -= bani;
		                    format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
		                    SCM(playerid,COLOR_ATTACK, szMessage);
		                }
		                else SCM(playerid, -1,"You don't have enought money.");
					}
	 	        }
	 	        else if(playerVariables[playerid][pCarSelected] == 3)
	 	        {
          			if(playerVariables[playerid][pInsurance] != 10)
 	        		{
					SendClientMessage(playerid, COLOR_ATTACK, "Ai deja 10 puncte de asigurare .");
					return 1;
					}
					if(points > 0)
					{
					    new bani = playerVariables[playerid][pInsurance3]*points;
					    if(playerVariables[playerid][pMoney] > bani)
					    {
							playerVariables[playerid][pInsurancePoints3] += points;
		                    playerVariables[playerid][pMoney] -= bani;
		                    format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
		                    SCM(playerid,COLOR_ATTACK, szMessage);
		                }
		                else SCM(playerid, -1,"You don't have enought money.");
					}
	 	        }
	 	        else if(playerVariables[playerid][pCarSelected] == 4)
	 	        {
          			if(playerVariables[playerid][pInsurance] != 10)
 	        		{
					SendClientMessage(playerid, COLOR_ATTACK, "Ai deja 10 puncte de asigurare .");
					return 1;
					}
					if(points > 0)
					{
					    new bani = playerVariables[playerid][pInsurance4]*points;
					    if(playerVariables[playerid][pMoney] > bani)
					    {
							playerVariables[playerid][pInsurancePoints4] += points;
		                    playerVariables[playerid][pMoney] -= bani;
		                    format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
		                    SCM(playerid,COLOR_ATTACK, szMessage);
		                }
		                else SCM(playerid, -1,"You don't have enought money.");
					}
	 	        }
	 	    }
 	    }
 	}

Am mai gasit ceva de la insurance poate va ajuta

Acolo ma ajutat Noname

 
		    if(playerVariables[playerid][pInsurance] == 10)
					{
    					SendClientMessage(playerid, COLOR_ATTACK, "Ai deja 10 puncte de asigurare .");
    					return 1;
					}
	if(listitem == 3)
			{
			    if(playerVariables[playerid][pCarSelected] == 1)
				{
				    if(playerVariables[playerid][pInsurance] == 10)
					{
    					SendClientMessage(playerid, COLOR_ATTACK, "Ai deja 10 puncte de asigurare .");
    					return 1;
					}
				    new da[500];
				    format(da, 500, "Cate puncte de asigurare vrei sa cumperi? %d / insurance point (%d/10)", playerVariables[playerid][pInsurance],playerVariables[playerid][pInsurancePoints]);
					ShowPlayerDialog(playerid, 22521, DIALOG_STYLE_INPUT,"Insurance",da,"Ok","Cancel");
				}
				else if(playerVariables[playerid][pCarSelected] == 2)
				{
				    if(playerVariables[playerid][pInsurance] == 10)
					{
    					SendClientMessage(playerid, COLOR_ATTACK, "Ai deja 10 puncte de asigurare .");
    					return 1;
					}
					new da[500];
				    format(da, 500, "Cate puncte de asigurare vrei sa cumperi? %d / insurance point (%d/10)", playerVariables[playerid][pInsurance2],playerVariables[playerid][pInsurancePoints2]);
					ShowPlayerDialog(playerid, 22521, DIALOG_STYLE_INPUT,"Insurance",da,"Ok","Cancel");
				}
				else if(playerVariables[playerid][pCarSelected] == 3)
				{
				    if(playerVariables[playerid][pInsurance] == 10)
					{
    					SendClientMessage(playerid, COLOR_ATTACK, "Ai deja 10 puncte de asigurare .");
    					return 1;
					}
					new da[500];
				    format(da, 500, "Cate puncte de asigurare vrei sa cumperi? %d / insurance point (%d/10)", playerVariables[playerid][pInsurance3],playerVariables[playerid][pInsurancePoints3]);
					ShowPlayerDialog(playerid, 22521, DIALOG_STYLE_INPUT,"Insurance",da,"Ok","Cancel");
				}
				else if(playerVariables[playerid][pCarSelected] == 4)
				{
				    if(playerVariables[playerid][pInsurance] == 10)
					{
    					SendClientMessage(playerid, COLOR_ATTACK, "Ai deja 10 puncte de asigurare .");
    					return 1;
					}
					new da[500];
				    format(da, 500, "Cate puncte de asigurare vrei sa cumperi? %d / insurance point (%d/10)", playerVariables[playerid][pInsurance4],playerVariables[playerid][pInsurancePoints4]);
					ShowPlayerDialog(playerid, 22521, DIALOG_STYLE_INPUT,"Insurance",da,"Ok","Cancel");
				}
			
			}
		}
	}
Link to comment
Share on other sites

  • 0

 Îmi cer scuze că am răspuns așa greu, am fost ocupat astăzi.  Încearcă așa:
 
 

if(playerVariables[playerid][pMoney] > bani)
		{
		        if((playerVariables[playerid][pInsurancePoints] += points) <= 10 )
				{
					playerVariables[playerid][pInsurancePoints] += points;
     				playerVariables[playerid][pMoney] -= bani;
		        	format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
		        	SCM(playerid,COLOR_ATTACK, szMessage);
				}
				else return SCM(playerid,COLOR_ATTACK, "Nu poti avea mai mult de 10 puncte de asigurare.");

		 }
qua8n0lrq5wl5v5xccbk.png
 
mf79y6bvavi9sp2qqfoi.png
Contact: Mail: [email protected]
Y!M: r3mus.onlypro
Skype: r3mus.onlypro
Link to comment
Share on other sites

  • 0
R3muSGFX Idea ta nu a fost rea.. Dr numai o data apare masajul ala de exemplu am cumparat 10puncte si dau sa mai cumpar 10 zice ca am deja 10 puncte dar.. daca dau a 2 oara ma lasa sa cumpar inca 10 adica 20..
if(dialogid == 22521)
  {
      if(response)
      {
          if(!isnull(inputtext))
          {
              new points = strval(inputtext);
if(points > 10) return SCM(playerid,COLOR_ATTACK, "Nu poti pune mai mult de 10 puncte");
       if(playerVariables[playerid][pCarSelected] == 1)
       {
if((playerVariables[playerid][pInsurancePoints] += points) <= 10 )
           {
SendClientMessage(playerid, COLOR_ATTACK, "Ai deja 10 puncte de asigurare .");
return 1;
}
if(points > 0)
{
   new bani = playerVariables[playerid][pInsurance]*points;
   if(playerVariables[playerid][pMoney] > bani)
   {
playerVariables[playerid][pInsurancePoints] += points;
                   playerVariables[playerid][pMoney] -= bani;
                   format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
                   SCM(playerid,COLOR_ATTACK, szMessage);
               }
               else SCM(playerid, -1,"You don't have enought money.");
}
       }
       else if(playerVariables[playerid][pCarSelected] == 2)
       {
        if((playerVariables[playerid][pInsurancePoints] += points) <= 10 )
           {
SendClientMessage(playerid, COLOR_ATTACK, "Ai deja 10 puncte de asigurare .");
return 1;
}
if(points > 0)
{
   new bani = playerVariables[playerid][pInsurance2]*points;
   if(playerVariables[playerid][pMoney] > bani)
   {
playerVariables[playerid][pInsurancePoints2] += points;
                   playerVariables[playerid][pMoney] -= bani;
                   format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
                   SCM(playerid,COLOR_ATTACK, szMessage);
               }
               else SCM(playerid, -1,"You don't have enought money.");
}
       }
       else if(playerVariables[playerid][pCarSelected] == 3)
       {
           if((playerVariables[playerid][pInsurancePoints] += points) <= 10 )
           {
SendClientMessage(playerid, COLOR_ATTACK, "Ai deja 10 puncte de asigurare .");
return 1;
}
if(points > 0)
{
   new bani = playerVariables[playerid][pInsurance3]*points;
   if(playerVariables[playerid][pMoney] > bani)
   {
playerVariables[playerid][pInsurancePoints3] += points;
                   playerVariables[playerid][pMoney] -= bani;
                   format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
                   SCM(playerid,COLOR_ATTACK, szMessage);
               }
               else SCM(playerid, -1,"You don't have enought money.");
}
       }
       else if(playerVariables[playerid][pCarSelected] == 4)
       {
           if((playerVariables[playerid][pInsurancePoints] += points) <= 10 )
         {
SendClientMessage(playerid, COLOR_ATTACK, "Ai deja 10 puncte de asigurare .");
return 1;
}
if(points > 0)
{
   new bani = playerVariables[playerid][pInsurance4]*points;
   if(playerVariables[playerid][pMoney] > bani)
   {
playerVariables[playerid][pInsurancePoints4] += points;
                   playerVariables[playerid][pMoney] -= bani;
                   format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
                   SCM(playerid,COLOR_ATTACK, szMessage);
               }
               else SCM(playerid, -1,"You don't have enought money.");
}
       }
   }
      }
  }
Ph0eniX unde tre sa pun aia ca ori unde asi puneo da eroare
Link to comment
Share on other sites

  • 0

Incearca asta:

if(response)
         {
             if(!isnull(inputtext))
             {
                 new points = strval(inputtext);
                 if(playerVariables[playerid][pInsurance] >= 1)
                {
                SendClientMessage(playerid, COLOR_ATTACK, "Ai deja 10 puncte de asigurare .");
                return 1;
                }
                if(points >= 10) return SCM(playerid,COLOR_ATTACK, "Nu poti pune mai mult de 10 puncte");
                 if(playerVariables[playerid][pCarSelected] == 1)
                 {
                    if(points = 0)
                    {
                        new bani = playerVariables[playerid][pInsurance]*points;
                        if(playerVariables[playerid][pMoney] > bani)
                        {
                            playerVariables[playerid][pInsurancePoints] += points;
                            playerVariables[playerid][pMoney] -= bani;
                            format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
                            SCM(playerid,COLOR_ATTACK, szMessage);
                        }
                        else SCM(playerid, -1,"You don't have enought money.");
                    }
                 }
                 else if(playerVariables[playerid][pCarSelected] == 2)
                 {
                     if(points = 0)
                    {
                        new bani = playerVariables[playerid][pInsurance2]*points;
                        if(playerVariables[playerid][pMoney] > bani)
                        {
                            playerVariables[playerid][pInsurancePoints2] += points;
                            playerVariables[playerid][pMoney] -= bani;
                            format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
                            SCM(playerid,COLOR_ATTACK, szMessage);
                        }
                        else SCM(playerid, -1,"You don't have enought money.");
                    }
                 }
                 else if(playerVariables[playerid][pCarSelected] == 3)
                 {
                    if(points = 0)
                    {
                        new bani = playerVariables[playerid][pInsurance3]*points;
                        if(playerVariables[playerid][pMoney] > bani)
                        {
                            playerVariables[playerid][pInsurancePoints3] += points;
                            playerVariables[playerid][pMoney] -= bani;
                            format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
                            SCM(playerid,COLOR_ATTACK, szMessage);
                        }
                        else SCM(playerid, -1,"You don't have enought money.");
                    }
                 }
                 else if(playerVariables[playerid][pCarSelected] == 4)
                 {
                    if(points = 0)
                    {
                        new bani = playerVariables[playerid][pInsurance4]*points;
                        if(playerVariables[playerid][pMoney] > bani)
                        {
                            playerVariables[playerid][pInsurancePoints4] += points;
                            playerVariables[playerid][pMoney] -= bani;
                            format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
                            SCM(playerid,COLOR_ATTACK, szMessage);
                        }
                        else SCM(playerid, -1,"You don't have enought money.");
                    }
                 }
             }
         }
     }
    if(dialogid == 15524)
    {
        if(response)
        {
            new car = listitem+1;
            playerVariables[playerid][pCarSelected] = car;
            ShowPlayerDialog(playerid, 15520, DIALOG_STYLE_LIST, "Vehicle options", "Respawn carnLocate carnVehicle infonBuy insurance", "Ok", "Cancel");
        }
    }

Daca ti-am fost de ajutor +1 Respect!Multumesc

Link to comment
Share on other sites

  • 0

Scuze greseala mea nu am observat undeva.Incearca acum

 

 

if(response)
     {
         if(!isnull(inputtext))
         {
             new points = strval(inputtext);
             if(playerVariables[playerid][pInsurance] > 0)
        {
        SendClientMessage(playerid, COLOR_ATTACK, "Ai deja 10 puncte de asigurare .");
        return 1;
        }
        if(points >= 1) return SCM(playerid,COLOR_ATTACK, "Nu poti pune mai mult de 10 puncte");
         if(playerVariables[playerid][pCarSelected] == 1)
         {
          if(points = 0)
          {
            new bani = playerVariables[playerid][pInsurance]*points;
            if(playerVariables[playerid][pMoney] > bani)
            {
              playerVariables[playerid][pInsurancePoints] += points;
                      playerVariables[playerid][pMoney] -= bani;
                      format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
                      SCM(playerid,COLOR_ATTACK, szMessage);
                  }
                  else SCM(playerid, -1,"You don't have enought money.");
          }
         }
         else if(playerVariables[playerid][pCarSelected] == 2)
         {
           if(points = 0)
          {
            new bani = playerVariables[playerid][pInsurance2]*points;
            if(playerVariables[playerid][pMoney] > bani)
            {
              playerVariables[playerid][pInsurancePoints2] += points;
                      playerVariables[playerid][pMoney] -= bani;
                      format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
                      SCM(playerid,COLOR_ATTACK, szMessage);
                  }
                  else SCM(playerid, -1,"You don't have enought money.");
          }
         }
         else if(playerVariables[playerid][pCarSelected] == 3)
         {
          if(points = 0)
          {
            new bani = playerVariables[playerid][pInsurance3]*points;
            if(playerVariables[playerid][pMoney] > bani)
            {
              playerVariables[playerid][pInsurancePoints3] += points;
                      playerVariables[playerid][pMoney] -= bani;
                      format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
                      SCM(playerid,COLOR_ATTACK, szMessage);
                  }
                  else SCM(playerid, -1,"You don't have enought money.");
          }
         }
         else if(playerVariables[playerid][pCarSelected] == 4)
         {
          if(points = 0)
          {
            new bani = playerVariables[playerid][pInsurance4]*points;
            if(playerVariables[playerid][pMoney] > bani)
            {
              playerVariables[playerid][pInsurancePoints4] += points;
                      playerVariables[playerid][pMoney] -= bani;
                      format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
                      SCM(playerid,COLOR_ATTACK, szMessage);
                  }
                  else SCM(playerid, -1,"You don't have enought money.");
          }
         }
     }
     }
   }
  if(dialogid == 15524)
  {
    if(response)
    {
      new car = listitem+1;
      playerVariables[playerid][pCarSelected] = car;
      ShowPlayerDialog(playerid, 15520, DIALOG_STYLE_LIST, "Vehicle options", "Respawn carnLocate carnVehicle infonBuy insurance", "Ok", "Cancel");
    }
  }
Edited by angel

Daca ti-am fost de ajutor +1 Respect!Multumesc

Link to comment
Share on other sites

  • 0

Acum nu mai pot cumpara nici un punct de asigurare zice ca nu pot pune mai mult de 10 puncte chair daca am 5 nu mai pot da nici 1 punct

if(dialogid == 22521)
 	{
      if(response)
 	    {
 	        if(!isnull(inputtext))
 	        {
 	            new points = strval(inputtext);
     			  if(playerVariables[playerid][pInsurance] > 0)
 	        		{
						SendClientMessage(playerid, COLOR_ATTACK, "Ai deja 10 puncte de asigurare .");
						return 1;
					}
					if(points >= 1) return SCM(playerid,COLOR_ATTACK, "Nu poti pune mai mult de 10 puncte");
        		    if(playerVariables[playerid][pCarSelected] == 1)
			  		{
					if(points > 0)
					{
					    new bani = playerVariables[playerid][pInsurance]*points;
					    if(playerVariables[playerid][pMoney] > bani)
					    {
							playerVariables[playerid][pInsurancePoints] += points;
		                    playerVariables[playerid][pMoney] -= bani;
		                    format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
		                    SCM(playerid,COLOR_ATTACK, szMessage);
		                }
		                else SCM(playerid, -1,"You don't have enought money.");
					}
	 	        }
	 	        else if(playerVariables[playerid][pCarSelected] == 2)
	 	        {
					if(points > 0)
					{
					    new bani = playerVariables[playerid][pInsurance2]*points;
					    if(playerVariables[playerid][pMoney] > bani)
					    {
							playerVariables[playerid][pInsurancePoints2] += points;
		                    playerVariables[playerid][pMoney] -= bani;
		                    format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
		                    SCM(playerid,COLOR_ATTACK, szMessage);
		                }
		                else SCM(playerid, -1,"You don't have enought money.");
					}
	 	        }
	 	        else if(playerVariables[playerid][pCarSelected] == 3)
	 	        {
					if(points > 0)
					{
					    new bani = playerVariables[playerid][pInsurance3]*points;
					    if(playerVariables[playerid][pMoney] > bani)
					    {
							playerVariables[playerid][pInsurancePoints3] += points;
		                    playerVariables[playerid][pMoney] -= bani;
		                    format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
		                    SCM(playerid,COLOR_ATTACK, szMessage);
		                }
		                else SCM(playerid, -1,"You don't have enought money.");
					}
	 	        }
	 	        else if(playerVariables[playerid][pCarSelected] == 4)
	 	        {
					if(points > 0)
					{
					    new bani = playerVariables[playerid][pInsurance4]*points;
					    if(playerVariables[playerid][pMoney] > bani)
					    {
							playerVariables[playerid][pInsurancePoints4] += points;
		                    playerVariables[playerid][pMoney] -= bani;
		                    format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
		                    SCM(playerid,COLOR_ATTACK, szMessage);
		                }
		                else SCM(playerid, -1,"You don't have enought money.");
					}
	 	        }
	 	    }
 	    }
 	}
Edited by alexandruo9
Link to comment
Share on other sites

  • 0

Cand ai 0 puncte si incerci sa cumperi 10,poti cumpara? de mai multe ori sau o singura data?...Tu vrei ca sa poata cumpara puncte pana in maxim 10 chiar daca mai are 9 sau 6..etc?

Da eu doresc sa poata cumpara maxim 10 puncte dar daca are de exemplu 5 sa poata cumpara inca 5 pana la 10.... Mersi mult ca ma ajuti

Link to comment
Share on other sites

  • 0
if(dialogid == 22521)
    {
            if(response)
            {
                if(!isnull(inputtext))
                {
                    new points = strval(inputtext);
                    if(playerVariables[playerid][pInsurance] == 10)
                                {
                                                SendClientMessage(playerid, COLOR_ATTACK, "Ai deja 10 puncte de asigurare .");
                                                return 1;
                                        }
                                        new amount;
                                        if(amount < 1 || amount > 10) return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}Nu poti cumpara mai putin de 1 sau mai mult de 10 puncte.");
                                        new check = playerVariables[playerid][pInsurance] + amount;
                                        if(check > playerVariables[playerid][pMaxInsurance])
                                        {
                                            format(string, sizeof(string), "{FFB870}Nu mai poti cumpara,ai deja %d puncte asigurare.",playerVariables[playerid][pInsurance]);
                                            SendClientMessage(playerid, COLOR_WHITE, string);
                                            return 1;
                                        }
                            			if(playerVariables[playerid][pCarSelected] == 1)
                                        {
                                        if(points >= 0)
                                        {
                                            new bani = playerVariables[playerid][pInsurance]*points;
                                            if(playerVariables[playerid][pMoney] > bani)
                                            {
                                                        playerVariables[playerid][pInsurancePoints] += points;
                                    playerVariables[playerid][pMoney] -= bani;
                                    format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
                                    SCM(playerid,COLOR_ATTACK, szMessage);
                                }
                                else SCM(playerid, -1,"You don't have enought money.");
                                }
                        }
                        else if(playerVariables[playerid][pCarSelected] == 2)
                        {
                                        if(points > 0)
                                        {
                                            new bani = playerVariables[playerid][pInsurance2]*points;
                                            if(playerVariables[playerid][pMoney] > bani)
                                            {
                                                        playerVariables[playerid][pInsurancePoints2] += points;
                                    playerVariables[playerid][pMoney] -= bani;
                                    format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
                                    SCM(playerid,COLOR_ATTACK, szMessage);
                                }
                                else SCM(playerid, -1,"You don't have enought money.");
                                        }
                        }
                        else if(playerVariables[playerid][pCarSelected] == 3)
                        {
                                        if(points > 0)
                                        {
                                            new bani = playerVariables[playerid][pInsurance3]*points;
                                            if(playerVariables[playerid][pMoney] > bani)
                                            {
                                                        playerVariables[playerid][pInsurancePoints3] += points;
                                    playerVariables[playerid][pMoney] -= bani;
                                    format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
                                    SCM(playerid,COLOR_ATTACK, szMessage);
                                }
                                else SCM(playerid, -1,"You don't have enought money.");
                                        }
                        }
                        else if(playerVariables[playerid][pCarSelected] == 4)
                        {
                                        if(points > 0)
                                        {
                                            new bani = playerVariables[playerid][pInsurance4]*points;
                                            if(playerVariables[playerid][pMoney] > bani)
                                            {
                                                        playerVariables[playerid][pInsurancePoints4] += points;
                                    playerVariables[playerid][pMoney] -= bani;
                                    format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
                                    SCM(playerid,COLOR_ATTACK, szMessage);
                                }
                                else SCM(playerid, -1,"You don't have enought money.");
                                        }
                        }
                    }
            }
		}

Am facut cum ai spus tu dar am niste erori!!

E:servergamemodesgamemode.pwn(15370) : error 017: undefined symbol "string"
E:servergamemodesgamemode.pwn(15370) : error 017: undefined symbol "string"
E:servergamemodesgamemode.pwn(15370) : error 029: invalid expression, assumed zero
E:servergamemodesgamemode.pwn(15370) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

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.