25.09.2009, 14:39
How is it possible to make Streamed in vehicles??
because i use CreateVehicles and in version RC7-2 for some reason the AttachTrailerToVehicle it really attaches for that side it work.... but
sometimes because of stream problems it gets like stucking the tow truck or disconnects and then after 2-3sec it comes straight to the tow truck like there is a person in it using a speed hack... but it wasn't someone else... ( tghou when i was alone in server it worked 100% fine no problems but when someone else came on and the player were passenger in the tow truck that i was driving. This is the code that i am using:
because i use CreateVehicles and in version RC7-2 for some reason the AttachTrailerToVehicle it really attaches for that side it work.... but
sometimes because of stream problems it gets like stucking the tow truck or disconnects and then after 2-3sec it comes straight to the tow truck like there is a person in it using a speed hack... but it wasn't someone else... ( tghou when i was alone in server it worked 100% fine no problems but when someone else came on and the player were passenger in the tow truck that i was driving. This is the code that i am using:
Код:
if(strcmp(cmd, "/tow", true) == 0) { if (IsTowTruck(GetVehicleModel(GetPlayerVehicleID(playerid)))) { new Float:pX,Float:pY,Float:pZ; GetPlayerPos(playerid,pX,pY,pZ); new Float:vX,Float:vY,Float:vZ; new Found=0; new vid=0; while ((vid<MAX_VEHICLES)&&(!Found)) { vid++; GetVehiclePos(vid,vX,vY,vZ); if((floatabs(pX-vX)<7.0)&&(floatabs(pY-vY)<7.0)&&(floatabs(pZ-vZ)<7.0)&&(vid!=GetPlayerVehicleID(playerid))) { Found=1; if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) { DetachTrailerFromVehicle(GetPlayerVehicleID(playerid)); } if(!VehicleToPoint(vid, VehicleInfo[vid][Xcar], VehicleInfo[vid][Ycar], VehicleInfo[vid][Zcar], 30)) { AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid)); SendClientMessage(playerid,COLOR_WHITE,"Towed, You can deliver it to the impound garage."); SetPlayerCheckpoint(playerid,691.2448,-1570.8842,14.2422,5); return 1; } else return SendClientMessage(playerid,COLOR_BRIGHTRED,"This vehicle is at its spawn, no need to tow it!"); } } if(!Found) { SendClientMessage(playerid,COLOR_BRIGHTRED,"There is nothing to tow!"); } } return 1; }