SA-MP Forums Archive
/myvehicles show lot of cars - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /myvehicles show lot of cars (/showthread.php?tid=376541)



/myvehicles show lot of cars - BlueGames - 10.09.2012

When i doing /myvehicles i see few cars im not own, also if other player doing it see the same cars id's

Код:
	if(strcmp(cmdtext,"/myvehicles",true)==0)
	{
	   new ownh[MAX_STRING],asker[MAX_STRING];
	   new dupe[MAX_STRING];
	    SendClientMessage(playerid,COLOR_BRIGHTRED,"|___________________________[VEHICLES]___________________________|");
		for(new i=0;i<sizeof(Vehicles);i++)
		{
		new path[32];
		    format(path,sizeof(path),"cars/Car%d.txt",Vehicles[i][cID]);
			ownh = dini_Get(path,"owner");
			dupe = dini_Get(path,"dupekey");
        	format(asker, MAX_STRING, "%s", PlayerName(playerid));
		    if(Vehicles[i][cartype] == 69)
		    {
		        if(Vehicles[i][cOwned] == 1 && strcmp(asker,ownh,false)==0 || Vehicles[i][cOwned] == 1 && strcmp(asker,dupe,false)==0 )
		        {
					if(strcmp(dini_Get(path,"owner"),PlayerName(playerid),false) == 0 || strcmp(dini_Get(path,"dupekey"),PlayerName(playerid),false) == 0 )
					{
					    new text[60];
						new atext[60];
						new btext[60];
//						new ctext[70];
      					if(Vehicles[i][cLocked] == 1) { text = "Yes"; }
						if(Vehicles[i][cLocked] == 0) { text = "No"; }
						if(Vehicles[i][cAlarm] == 1) { atext = "Yes"; }
					if(Vehicles[i][cAlarm] == 0) { atext = "No"; }
						if(Vehicles[i][impounded] == 1) { btext = "Yes";}
						if(Vehicles[i][impounded] == 0) { btext = "No";}
						format(string, sizeof(string), "CarID[%d] - Model [%d] - Color1[%d] - Color2[%d] - Security[%s] - Security Status[%s] ",Vehicles[i][cID],Vehicles[i][carmodel],Vehicles[i][cColor1],Vehicles[i][cColor2],atext,text,btext);
						SendClientMessage(playerid,COLOR_GREY,string);
					}
				}
			}
			else continue;
		}
		return 1;
	}



Re: /myvehicles show lot of cars - BlueGames - 11.09.2012

Help ?


Re: /myvehicles show lot of cars - BlueGames - 11.09.2012

Are yoy srsly? You read what i typed ? Cmd show cars are player not own!
I have dealership i dont need save it, LAWL !!


Re: /myvehicles show lot of cars - mamorunl - 11.09.2012

Can you give some more information about the variables? Like how is Vehicles built up and what is 'dupe' and such?


Re: /myvehicles show lot of cars - BlueGames - 11.09.2012

Well vehicles system build like that:
You can give dupe keys to some player you want via /car dupekey
You can sell it also buy from players
All vehicle have id ofc, That alwyas had this problem also i have this shit isuss with /myhouses and its show like you own all houses in server and its 1,000 houses, Also with /mybusinesses its show the bank0 and banksf.
Please help me i'll rep the helpers


Re: /myvehicles show lot of cars - mamorunl - 11.09.2012

Quote:
Originally Posted by BlueGames
Посмотреть сообщение
Well vehicles system build like that:
You can give dupe keys to some player you want via /car dupekey
You can sell it also buy from players
All vehicle have id ofc, That alwyas had this problem also i have this shit isuss with /myhouses and its show like you own all houses in server and its 1,000 houses, Also with /mybusinesses its show the bank0 and banksf.
Please help me i'll rep the helpers
What is cartype? Vehicles[i][cartype] == 69

Also: your If statement has a double check. I assume you want to have two AND statements and one OR but this way it checks it all and not in groups. Suggest you put them in groups if that is what you want:

if((condition1 && condition2) || (condition3 && condition1)) has an other effect than: if(condition 1 && condition2 || condition3 && condition1)

(Also, you can't rep people yet since you don't have 50 posts)


Re: /myvehicles show lot of cars - BlueGames - 11.09.2012

Well, im not at home to tell you the cartype, will be there soon.
How do i do it, i mean how to add this "group" you said and to where?


Re: /myvehicles show lot of cars - mamorunl - 11.09.2012

Quote:
Originally Posted by BlueGames
Посмотреть сообщение
Well, im not at home to tell you the cartype, will be there soon.
How do i do it, i mean how to add this "group" you said and to where?
pawn Код:
if(Vehicles[i][cOwned] == 1 && strcmp(asker,ownh,false)==0 || Vehicles[i][cOwned] == 1 && strcmp(asker,dupe,false)==0 )
You currently have this.

You could make it like this:

pawn Код:
if(Vehicles[i][cOwned] == 1 && (!strcmp(asker, ownh, false) || !strcmp(asker, dupe, false)))
Because it basically does the same.


Re: /myvehicles show lot of cars - justinnater - 11.09.2012

Your whole car system is bugged.

Ryan Blazer


Re: /myvehicles show lot of cars - BlueGames - 12.09.2012

Quote:
Originally Posted by justinnater
Посмотреть сообщение
Your whole car system is bugged.

Ryan Blazer
Your brain is bugged just this shit bugged.