SA-MP Forums Archive
Owned Vehicle System. - 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: Owned Vehicle System. (/showthread.php?tid=607252)



Owned Vehicle System. - Luicy. - 16.05.2016

Hi, So while creating my system, I finished,

http://pastebin.com/0iVzLA8t

The Problem is, In the log file, It gives around 100+ logs with empty %i etc, and in game, it doesn't spawn any vehicle, If i remove ! from line 53, It only gives timelog, Which is from the log stock, So it doesn't respond then, Neither do the cars come, Here's the 1.ini from vehicles folder.
http://pastebin.com/p09SzDvS


Re: Owned Vehicle System. - Luicy. - 17.05.2016

Bump


Re: Owned Vehicle System. - Luicy. - 17.05.2016

Update: I counted the log files, And it came up with 250 lines of this repeating:
PHP код:
[08:44:00Spawning Owned Vehicle IDOwner:  | X0.000000 Y0.000000 Z0.000000 



Re: Owned Vehicle System. - Infinity - 17.05.2016

It appears that it is spawning the vehicle at X=0, Y=0, Z=0, which is why you don't see it. Are you sure you are saving/loading the position correctly?


Re: Owned Vehicle System. - Luicy. - 17.05.2016

The position isn't important now, It's something with the load system, Since it loads 250 files that doesn't exist, There's only 1.ini, which is mine, But the information doesn't load.


Re: Owned Vehicle System. - Infinity - 17.05.2016

So what is the issue? You say that the cars don't spawn, yet it seems they do spawn at (0,0,0).


Re: Owned Vehicle System. - Luicy. - 17.05.2016

This is the problem:
* The car(s) don't spawn when the owner logs in.
* In the log file, When ever someone logs in, It gives 250 log lines as I said above.


Re: Owned Vehicle System. - MBilal - 17.05.2016

I think Problem is in this statement But I'm not sure.
Look like when any budy login even his name didn't match with ovOwner name it will get inside that statement.
Because he have no vehicle no x y z it spawn car at 0 0 0 maybe I'm wrong.
Try to compare both strings use True or false.

if(strcmp(ov_Stats[i][ovOwner], GetName(playerid),false) == 0)

When set to true, the case doesn't matter - HeLLo is the same as Hello. When false, they're not the same.
http://forum.sa-mp.com/showpost.php?...34&postcount=5


Re: Owned Vehicle System. - Infinity - 17.05.2016

Okay.

Quote:
Originally Posted by Meller
Посмотреть сообщение
This is the problem:
* The car(s) don't spawn when the owner logs in.
Are you sure that, as I said before, they don't spawn at (0,0,0)?

Quote:
Originally Posted by Meller
Посмотреть сообщение
* In the log file, When ever someone logs in, It gives 250 log lines as I said above.
That's because you've defined MAX_VEHICLES_OWNED as 250. You never check if the file actually exists, so I assume it will not overwrite the currently stored data. (Position being (0,0,0))
Also, because you never check if the file exists, it will print 250 (MAX_VEHICLES_OWNED) lines containing the information of the first.