31.03.2009, 15:17
Right it dosent come up with UNKNOWN command but it dosen't do anything when i type /attach.
I did some searching and found some stocks to put in but it still dosent work.
Scripit:
Stocks
Please help. I have done this before so don't say it's not possible.
Or give me a tow script but without a certain vehilce
Thanks in advance
I did some searching and found some stocks to put in but it still dosent work.
Scripit:
Quote:
if(strcmp(cmd, "/attach", true) == 0) { if(IsPlayerInAnyVehicle(playerid)) { new vehid; new vehid2; vehid = GetPlayerVehicleID(playerid); vehid2 = GetClosestVehicle(playerid); AttachTrailerToVehicle(vehid,vehid2); } return 1; } |
Quote:
stock GetClosestVehicle(playerid) { new vehicle = -1, Float:dis = 2000.0; for(new i = 0; i < MAX_VEHICLES; i++) { new Float:dis2 = GetPlayerDistanceToVehicle(playerid, i); if(dis2 > dis) { dis = dis2; vehicle = i; } } return vehicle; } stock Float:GetPlayerDistanceToVehicle(playerid, vehicleid) { new Floatos[3]; GetVehiclePos(vehicleid, pos[0], pos[1], pos[2]); return GetPlayerDistanceToPoint(playerid, pos[0], pos[1], pos[2]); } stock Float:GetPlayerDistanceToPoint(playerid, {Float,_}:...) { new num = numargs(), Floatos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]); if(num == 3) return floatsqroot(floatpower(floatabs(floatsub(pos[0], Float:getarg(1))), 2) + floatpower(floatabs(floatsub(pos[1], Float:getarg(2))), 2)); else if(num == 4) return floatsqroot(floatpower(floatabs(floatsub(pos[0], Float:getarg(1))), 2) + floatpower(floatabs(floatsub(pos[1], Float:getarg(2))), 2) + floatpower(floatabs(floatsub(pos[2], Float:getarg(3))), 2)); return -1.0; } |
Or give me a tow script but without a certain vehilce
Thanks in advance