sqpp15

x

Mar 14th, 2014
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.61 KB | None | 0 0
  1. cars = {}
  2. _carid = 1;
  3.  
  4. function SpawnCar(car, x, y, rot, owner)
  5.     if not rot then rot = 0 end;
  6.     if not owner then owner = 0 end;
  7.     if owner > 0 then
  8.         if Player[owner] ~= nil then
  9.             table.insert(Player[owner].cars, _carid);
  10.         end
  11.     end
  12.     local t = {};
  13.     t.enabled = true;
  14.     t.x = x;
  15.     t.y = y;
  16.     t.type = car;
  17.     t.gfx = image(car_types[car].gfx_path, x, y, car_types[car].top);
  18.     imagepos(t.gfx, x, y, rot);
  19.     t.owner = 0;
  20.     t.players = {};
  21.     t.cid = _carid;
  22.     t.cowner = owner;
  23.     t.cplayers = {};
  24.     t.cdrivers = {};
  25.     t.health = car_types[car].health;
  26.     cars[_carid] = t;
  27.     local _, i;
  28.     _carid = _carid + 1;
  29. end
Advertisement
Add Comment
Please, Sign In to add comment