SA-MP Forums Archive
Dynamic Vehicles can't create more than one. - 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: Dynamic Vehicles can't create more than one. (/showthread.php?tid=517113)



Dynamic Vehicles can't create more than one. - MikkaVanBuuren - 03.06.2014

I think i've reached the max amount of dynamic vehicles, although I changed the maximum amount of dynamic to a 1000 in the defines, everytime I try to spawn two, the first one will spawn, then when I spawn it again, it will grab the first one again.


Re: Dynamic Vehicles can't create more than one. - MikkaVanBuuren - 09.06.2014

I searched more and I found that it is not creating the vehicles in the mysql table.

What do I do?


Re: Dynamic Vehicles can't create more than one. - Laure - 09.06.2014

Do you mean when you try to teleport one vehicle to you, the other gets teleported?


Re: Dynamic Vehicles can't create more than one. - MikkaVanBuuren - 09.06.2014

Quote:
Originally Posted by Imperor
Посмотреть сообщение
Do you mean when you try to teleport one vehicle to you, the other gets teleported?
When I create a new dynamic vehicle, the last one that was created will get sent back to me.


Re: Dynamic Vehicles can't create more than one. - iFiras - 09.06.2014

Show us your code please.


Re: Dynamic Vehicles can't create more than one. - MikkaVanBuuren - 09.06.2014

Quote:

[2014/6/8 - 4:18:47] Jay Stone has created a dynamic vehicle.
[2014/6/8 - 4:18:47] Jay Stone's DV Creation query has returned - attempting to spawn vehicle - SQL ID 320
[2014/6/8 - 4:18:50] Jay Stone has created a dynamic vehicle.
[2014/6/8 - 4:18:50] Jay Stone's DV Creation query has returned - attempting to spawn vehicle - SQL ID 0
[2014/6/8 - 4:19:02] Jay Stone has edited DV Slot 0 - 873 delete.
[2014/6/8 - 4:19:45] Jay Stone has created a dynamic vehicle.
[2014/6/8 - 4:19:45] Jay Stone's DV Creation query has returned - attempting to spawn vehicle - SQL ID 0
[2014/6/8 - 4:19:50] Jay Stone has created a dynamic vehicle.
[2014/6/8 - 4:19:50] Jay Stone's DV Creation query has returned - attempting to spawn vehicle - SQL ID 0

After that SQL ID 320, it stops working and keeps on recreating the one vehicle.


Re: Dynamic Vehicles can't create more than one. - zT KiNgKoNg - 10.06.2014

Quote:
Originally Posted by MikkaVanBuuren
Посмотреть сообщение
After that SQL ID 320, it stops working and keeps on recreating the one vehicle.
We cannot help you without the code (this is clearly a log of some sort)


Re: Dynamic Vehicles can't create more than one. - MikkaVanBuuren - 16.06.2014

Quote:
Originally Posted by zT KiNgKoNg
Посмотреть сообщение
We cannot help you without the code (this is clearly a log of some sort)
What exactly do you want me to provide?


Re: Dynamic Vehicles can't create more than one. - RenovanZ - 16.06.2014

Quote:
Originally Posted by MikkaVanBuuren
Посмотреть сообщение
What exactly do you want me to provide?
Your createvehicle command of course.


Re: Dynamic Vehicles can't create more than one. - MikkaVanBuuren - 16.06.2014

Quote:
Originally Posted by RenovanZ
Посмотреть сообщение
Your createvehicle command of course.
PHP код:
CMD:dvcreate(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >= 4)
    {
        new
                
iVehicle,
                
iColors[2],
                
string[128];
        if(
sscanf(params"iii"iVehicleiColors[0], iColors[1])) {
            return 
SendClientMessageEx(playeridCOLOR_GREY"USAGE: /dvcreate [model ID] [color 1] [color 2]");
        }
        if(!(
400 iVehicle 612)) return SendClientMessage(playeridCOLOR_GRAD2"Invalid Model ID");
        else if(
IsATrain(iVehicle)) {
                
SendClientMessageEx(playeridCOLOR_GREY"Trains cannot be spawned during runtime.");
            }
        else if(!(
<= iColors[0] <= 255 && <= iColors[1] <= 255)) {
            
SendClientMessageEx(playeridCOLOR_GRAD2"Invalid color specified (IDs start at 0, and end at 255).");
        }
        
mysql_function_query(MainPipeline"SELECT id from `groupvehs` WHERE vModel = 0 LIMIT 1;"true"DynVeh_CreateDVQuery""iiii"playeridiVehicleiColors[0], iColors[1]);
        
format(stringsizeof(string), "%s has created a dynamic vehicle."GetPlayerNameEx(playerid));
        
Log("logs/dv.log"string);
    }
    else return 
SendClientMessage(playeridCOLOR_GRAD2"You're not authorized to use this command.");
    return 
1;