Help: /mycars
#1

Hi

I have command /mycars - but it doesn't work, because: SERVER:Unknown command

I tried to put prints and it works to number 3 (problem is format maybe)

Код:
dcmd_mycars(playerid, params[])
{
	#pragma unused params
    for(new i=0; i< MAX_VEHICLES; i++)
    {
        print("0");
        if(fexist(VehiclePath(i)))
        {
            print("1");
	        if(!strcmp(CarOwner[i], PlayerName(playerid), false))
	        {
	            print("2");
				new string[200];
    			strcat(string, "VehicleID: "COL_LIGHTBLUE"%d"COL_WHITE" | Model: "COL_LIGHTBLUE"%s"COL_WHITE" | Zamčenй: "COL_LIGHTBLUE"%s"COL_WHITE" | Benzнn: "COL_LIGHTBLUE"%dl"COL_WHITE" | Najeto: "COL_LIGHTBLUE"%dkm", sizeof(string));
                print("3");
				format(string, sizeof(string), string, i, SeznamAut[CarModel[i] - 400], AnoNe[CarLock[i]], CarFuel[i], CarNajeto[i]);
				SCM(playerid, COLOR_WHITE, string);
				print("4");
		    }
	    }
	}
	return 1;
}
Thank you for your help.
Reply
#2

The problem is that you used strcat before format, you should use format and then strcat
Reply
#3

Quote:
Originally Posted by NeXTGoD
Посмотреть сообщение
The problem is that you used strcat before format, you should use format and then strcat
It's not really problem, it doesn't work still, but thank you.
Reply
#4

Put "new string" out oft the loop.
Reply
#5

very badly written gamemode, there is no point for developing this forward. you just dont use ini system for vehicles. and dcmd shit
Reply
#6

Quote:
Originally Posted by CodeStyle175
Посмотреть сообщение
very badly written gamemode, there is no point for developing this forward. you just dont use ini system for vehicles. and dcmd shit
Thank you for your help!!! I have never didn't see guy who can rate gamemode where he saw 20 lines of code can you write me why shouldn't I use ini and dcmd ?
Reply
#7

Код:
new string[500],string2[256];
format(string2, sizeof string2,  "VehicleID: "COL_LIGHTBLUE"%d"COL_WHITE" | Model: "COL_LIGHTBLUE"%s"COL_WHITE" | Zamčenй: "COL_LIGHTBLUE"%s"COL_WHITE" | Benzнn: "COL_LIGHTBLUE"%dl"COL_WHITE" | Najeto: "COL_LIGHTBLUE"%dkm", i, SeznamAut[CarModel[i] - 400], AnoNe[CarLock[i]], CarFuel[i], CarNajeto[i]);
strcat(string, , string2);
SCM(playerid, COLOR_WHITE, string);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)