[Include] [INC]Advanced Vehicle Streamer/Cmds - NEW - UPDATED 18/04/08
#1

[INC] tAxI's Advanced Vehicle Streamer/Commands

-=<:: Credits to On_Top_Non_Stop for the SetStreamVehicleHealth command ::>=-

OK this system is a fairly hefty modification for almost all of the vehicle commands that are native to sa-mp and they are designed to totally replace the vehicle commands with a more advanced system. Currently the system boasts:

THE ONLY vehicle streamer on sa-mp to date (yay to me lol)

AutoStream backup just in case ppl miss any normal create or add vehicles in their script(this will replace all normal vehicles with streamed vehicles - nice little innovation i came up with last nite :P - cannot be deactivated :P)

Toggle autosave of vehicle mods and color changes - when activated will save any mods made to a vehicle in default modshop like tansfender or WAA or loco etc and when the vehicle is destroyed it will respawn with the mods still applied (can be disabled in script if not needed - also only works as long is server is running, mods will be lost on server restart)

Pretty much all vehicle commands including link to interior, params, mods, virtualworld etc etc etc etc

New system that monitors abandoned vehicles and resets them after 5 minutes of inactivity - useful for clearing up unused vehicles that are just randomly lieing around

There is a readme file inside the Package to help you install it and correctly use it.

Click HERE to download

Currently this is the list of commands and callbacks included in the streamer package:


================================================== ===========================================

native tAxI_OnGameModeInit()
native tAxI_OnVehicleDeath(vehicleid)
native tAxI_OnPlayerEnterVehicle(playerid,vehicleid)
native tAxI_OnPlayerExitVehicle(vehicleid)
native tAxI_OnVehicleMod(vehicleid,componentid)
native tAxI_OnVehicleRespray(vehicleid,color1,color2)
native tAxI_OnVehiclePaintjob(vehicleid,paintjobid)
native tAxI_OnVehicleSpawn(vehicleid)
native tAxI_OnPlayerKeyStateChange(playerid,newkeys)
native SetBikeAntiFallForPlayer(playerid,bool:toggle)
native ToggleAutoModSave(bool:toggle)
native CreateStreamVehicle(modelid,Float,Float:y,Float: z,Float:a,col1,col2)
native DestroyStreamVehicle(vstreamid)
native SetStreamVehicleToRespawn(vstreamid)
native CreateTempStreamVehicle(modelid,Float,Float:y,Fl oat:z,Float:a,col1,col2)
native GetPlayerVehicleStreamID(playerid)
native GetVehicleStreamID(vehicleid)
native GetVehicleStreamModel(vstreamid)
native GetStreamVehicleID(vstreamid)
native SetStreamVehiclePos(vstreamid,Float,Float:y,Floa t:z,Float:a)
native SetVehicleStreamSpawnInfo(vstreamid,vmodel,Float ,Float:y,Float:z,Float:a,color1,color2)
native ForceStreamVehicleSpawn(vstreamid,Float,Float:y, Float:z,Float:a,worldid,interiorid,objective,UseSa vedMods)
native ChangeStreamVehiclePaintjob(vstreamid,paintjobid)
native ChangeStreamVehicleColor(vstreamid,col1,col2)
native AddStreamVehicleMod(vstreamid,componentid)
native SetStreamVehicleParamsForPlayer(vstreamid,playerid ,objective,doorslocked);
native LinkStreamVehicleToInterior(vstreamid,interiorid)
native SetStreamVehicleVirtualWorld(vstreamid,world)
native GetStreamVehicleVirtualWorld(vstreamid)
native ImportModsFromFile(const savefile[])
native ExportModsToFile(const savefile[])
native GetStreamVehiclePos(vstreamid,Float:&Xpos,Float:&Y pos,Float:&Zpos)
native GetStreamVehicleZAngle(vstreamid,Float:&Angle)
native PutPlayerInStreamVehicle(playerid,vstreamid)
native SetStreamVehicleHealth(vstreamid,Float:health)

================================================== ===========================================


I make no assurances that this will work 100% yet but it is pretty good from what i can see...still in BETA stages though so let me know how its running guys

ENJOY!!!
Reply
#2

Thanks Alot Taxi, I have been using an older FS of yours for months with great success. I am hopefull for this inc as well.
Reply
#3

OMFG D lol 10x

Tks Taxis, i need this a long time, the last vesion dont work here...

Iґll try now

Reply
#4

Nope x) When I open the server's exe file, after 2-3 seconds everything crashes.
Reply
#5

Crash -.-
Does not!
Crashes from when it leaves 5 minutes
Reply
#6

Nice work, May I reccommend a SetStreamVehicleParamsForPlayer?

Anyway, nice work!
Reply
#7

Heh, very handy Inc to have, I'm gonna test it, see if it's good enough for our server. :P

I will report how it goes.
Quote:
Originally Posted by Reports
AMX SIZE :
Without Streamer = 649kb
With Streamer = 816kb
Your last Streamer make my AMX file 5mb's lol
Reply
#8

i will test it but i can't. It shows:

Code:
C:\Users\Kevin\Desktop\san andreas server pearl harbor\gamemodes\ph.pwn(13) : fatal error 100: cannot read from file: "vstream"

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
I have the include vstream in: my server/pawno/include
Reply
#9

OK, I checked into this a bit for debug, the crash happens because of tAxI_OnGameModeInIt(); but more particularly, InitiateSectorSystem(); which creates TextDraws, those crash my samp. I edited them out and it seems to be stable for now, will check back later for more.
Reply
#10

yeah im kind of new to textdraw myself - i added that as a last mnute consideration for administrators - its got nothign to do wit the overall function of the streamer :S so removing it should do no harm at all...also im not sure if maybe u have to use textdrawcreate etc at ongamemodeinit so maybe thats whats wrong :S

one other bit i was having probs with was the CountModels() not returning anything but i THINK i fixed it...comment out all of them and see what happens...basically it was screwing it up and nothing used to spawn with it but hopefully thats been fixed in this version
Reply
#11

nice work, mate!
Reply
#12

Quote:
Originally Posted by <tAxI>
yeah im kind of new to textdraw myself - i added that as a last mnute consideration for administrators - its got nothign to do wit the overall function of the streamer :S so removing it should do no harm at all...also im not sure if maybe u have to use textdrawcreate etc at ongamemodeinit so maybe thats whats wrong :S

one other bit i was having probs with was the CountModels() not returning anything but i THINK i fixed it...comment out all of them and see what happens...basically it was screwing it up and nothing used to spawn with it but hopefully thats been fixed in this version
Yeah i took it out and everything was much better.

Maybe this will be interesting for you, I think BeckzyBoi or IJRezenRita (or w/e) put this snippet somewhere at some point:

pawn Код:
new mt[212], hm;
for (new v = 1; v <= 700; v ++)
if (GetVehicleModel(v)) mt[GetVehicleModel(v)-400] ++;
for (new et2; et2 < sizeof(mt); et2 ++) if (mt[et2]) hm ++;
format(mt, 45, "This server has %d different vehicle models.", hm);
SendClientMessage(playerid, 0xFFFFFFAA, mt);
I'm using this and it counts every model created, whether it be via addstatic, createvehicle or in this case, createstreamvehicle. If the vehicle model is spawned it will be counted, but it wont count whats not spawned yet.

EDIT: Nope -- This still crashes after it runs awhile, same problem as before.
Reply
#13

hmmm i wander whats doing it :S - i'll look into it myself - is there any pattern to whats happening when it happens?
Reply
#14

Nope, just some random car spawns and never stops spawning until everything crashes x)
Reply
#15

ah ok i thought this might happen - theres a bug that i thought id fixed that spawns a randomly allocated vehicle and keeps doing it untill a limit is breeched and CRASH!!!!!!!!!!! ok ill try and sort it right now
Reply
#16

nice work taxi
what is the max models/vehicle limit?
Reply
#17

700 vehicles 70 models.
Reply
#18

lol check again thats the maximum active amount - you can actually have around 2500 vehicles and all the models u like (211 default) but just not active...id reccomend spreading vehicles out if ur going for that many lol :S

EDIT - Fixed the textdraw bug and i was running around lv for 10 minutes earlier with no crashes so i think ive managed to fix it...just uploading once I've finished implementing SetStreamVehicleParamsForPlayer - I'm thinking that its gonna be a wee while yet but we shall see how this goes lol

ill implement for player and for all at the same time...save me the work of doing it later...I'm also gonna implement setvehiclevirtualworld for the streams as well


so next update is 3 new shiney commands - plus im maybe gonna implement auto modsaving option so if a player mods their vehicle in a mod garage the mod is saved on that vehicle and u can toggle that via a custom function as well

its not a hugely complicated amount just time consuming so maybe gimmi a couple hours to work thru that

its also worth noting guys that this will become a very hefty package very quickly as i'm developing it so don't worry about the AMX compiled sizes going up cos its an unfotunate requirement of the system :S
Reply
#19

thanks taxi i really needed this keep your good work men
Reply
#20

UPDATED - MAJOR COMMAND UPDATES!!!!!!!!

new commandlist - remember to add the new callbacks (anything with "tAxI_" at the start is required to go under the matching script default callback) and without the new callbacks system may crash or just screw up something bad lol :P

native tAxI_OnGameModeInit()
native tAxI_OnVehicleDeath(vehicleid)
native tAxI_OnPlayerEnterVehicle(vehicleid)
native tAxI_OnVehicleMod(vehicleid,componentid)
native tAxI_OnVehicleRespray(vehicleid,color1,color2)
native tAxI_OnVehiclePaintjob(vehicleid,paintjobid)
native ToggleAutoModSave(bool:toggle)
native CreateStreamVehicle(modelid,Float,Float:y,Float: z,Float:a,col1,col2)
native CreateTempStreamVehicle(modelid,Float,Float:y,Fl oat:z,Float:a,col1,col2)
native GetPlayerVehicleStreamID(playerid)
native GetVehicleStreamID(vehicleid)
native SetVehicleStreamPos(vstreamid,Float,Float:y,Floa t:z,Float:a)
native SetVehicleStreamModel(vstreamid,model)
native ChangeStreamVehiclePaintjob(vstreamid,paintjobid)
native ChangeStreamVehicleColor(vstreamid,col1,col2)
native AddStreamVehicleMod(vstreamid,componentid)
native SetStreamVehicleParamsForPlayer(vstreamid,playerid ,objective,doorslocked);
native LinkStreamVehicleToInterior(vstreamid,interiorid)
native SetStreamVehicleVirtualWorld(vstreamid,world)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)