/myvehicles show lot of cars
#1

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;
	}
Reply
#2

Help ?
Reply
#3

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

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

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
Reply
#6

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)
Reply
#7

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?
Reply
#8

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.
Reply
#9

Your whole car system is bugged.

Ryan Blazer
Reply
#10

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

Ryan Blazer
Your brain is bugged just this shit bugged.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)