Jump to content

Wisin

Members
  • Posts

    126
  • Joined

  • Last visited

Everything posted by Wisin

  1. Wisin

    track player

    dosn't works makes this error: attempt to call global 'getDistanceBetweenElements2D' (a nil value), at line: local distanceBetweenPlayerAndBot = getDistanceBetweenElements2D(px,py,rx,ry)
  2. hi again, i want to know how i can do like i got a DX rectangle in top of screen and i wanna slowly move it up, how would i do that?
  3. Wisin

    track player

    i made this but keeps returning "north" and "east" x, y, z = getElementPosition ( ped ) x2, y2, z2 = getElementPosition ( player ) distance = getDistanceBetweenPoints2D ( x, y, x2, y2 ) local newvalue = math.floor ( distance ) local loc = getAngleBetweenPoints2D(x,y,x2,y2,x,y2) if loc < 45 then loca = "north" elseif loc < 135 then loca = "east" elseif loc < 225 then loca = "south" elseif loc < 315 then loca = "west"
  4. Wisin

    track player

    oh sorry i didn't readed it all, all directions.
  5. Wisin

    track player

    thats my question, can you give me a little example of what i need to make?
  6. Wisin

    track player

    hi, i made a track script that allows the player to track another player and a label will appear at screen with the meters he is from you, all working fine but i want to make like "Robot is approximately 50 north from you" my question is, how i make that "north" or "south"? thanks in advance.
  7. this error never happend at my test server but it happends at public server some times so i don't even know how it starts.
  8. yeah but why if some times works fine?
  9. does someone have idea about what is failing
  10. hi, i got a big bug, i've made a game mode and works like this, you click on a city from a grid list then a team then select the skin and when click "Accept" button will setElementData of city team and skin and then i use onPlayerSpawn to spawn him but dunno why some times it spawns everyone as CJ and falling down at cords 0,0,1000. also outputs this errors, bad argument @ 'xmlNodeGetAttributes' - Line: 32 attempt to index global 'playerAttributes' (a boolean value) line 32 = playerAttributes = xmlNodeGetAttributes(player) function playerSpawn() local playerTeam = getElementData(source, "team") local playerSkin = getElementData(source, "skin") check(source) local xmlFile = xmlLoadFile("Spawns.xml") player = xmlFindChild(xmlFile, "skin", playerSkin-1) playerAttributes = xmlNodeGetAttributes(player) local positionX = playerAttributes.x local positionY = playerAttributes.y local positionZ = playerAttributes.z setElementModel(source, playerAttributes.id) setElementPosition(source, positionX, positionY, positionZ) I = 0 while (xmlFindChild(player, "weapon", I)) do local weapon = xmlFindChild(player, "weapon", I) local weaponAttributes = xmlNodeGetAttributes(weapon) giveWeapon(source, weaponAttributes.name, weaponAttributes.amount) I = I + 1 end end addEventHandler("onPlayerSpawn", getRootElement(), playerSpawn)
  11. function onUse(hitPlayer) local team = getPlayerTeam(hitPlayer) local teamName = getTeamName(team) local eleData = getElementData(source,"team") if eleData == teamName then else cancelEvent() end end addEventHandler("onPickupHit",getRootElement(),onUse) thats it.
  12. i've found a problem, i got a money drop script but i think this other pickups for teams is messing with it, here is my money drop script function createMoney(player) local x, y, z = getElementPosition(player); local x1, y1, x2, y2; x1 = (x-2)+(math.random()*4); y1 = (y-2)+(math.random()*4); x2 = (x-2)+(math.random()*4); y2 = (y-2)+(math.random()*4); local moneyAmmount = getPlayerMoney(player); -- it is not fair too get all the player money. moneyAmmount = math.floor(moneyAmmount/1); takePlayerMoney(player, moneyAmmount); -- We are going to create 2 pickups, zo we are just cut the ammount in half moneyAmmount = math.floor(moneyAmmount/2); -- Create the pickups setElementData(createPickup(x1, y1, z, 3, 1212), "ammount", moneyAmmount); setElementData(createPickup(x2, y2, z, 3, 1212), "ammount", moneyAmmount); end function moneyPickupHit(player) local money = getElementData(source, "ammount"); if money then givePlayerMoney(player, money); destroyElement(source); end end function playerJustGotDied(ammo, attacker, weapon, bodypart) createMoney(source); end addEventHandler("onPickupUse", getRootElement(), moneyPickupHit); addEventHandler("onPlayerWasted", getRootElement(), playerJustGotDied);
  13. Thank you varez its working
  14. ok but from what i get the element data?
  15. hello all, i made a map file which containts pickups and i want to restrict them to a team expecified, so i did, <pickup id="pickup (health) (1)" type="health" interior="0" amount="100" respawn="30000" dimension="0" posX="1665.3149414063" posY="-1909.2155761719" posZ="21.954151153564" rotX="0" rotY="0" rotZ="0" team="Chinese" /> but now i don't know how to check that team and if matches with player team he can pick it else it will cancel the event, if someone can tell me how. thanks
  16. can someone tell me how to do the last thing i asked?
  17. Well said, you "think".. https://wiki.multitheftauto.com/wiki/GetAccount https://wiki.multitheftauto.com/wiki/GetAccounts You are my salvation dude! thank you very much! Edit: Hmm could someone give me a little example of how i can get the highest kills from the table of accounts?
  18. ok then i think the sqlite from mta would be nice?
  19. i'm actually using account data to save their kills, but my question is how i can retrive highest data and stop adding when reaches 10? hope someone can give me a code to start
  20. hey, i want to make a resource of 10 best players in server, i've done a gui added a grid list and now i need help about how i can get from a kills data the best 10 players? if someone can help me i will be really appreciated.
  21. Wisin

    inventory system

    my original idea was to use sqlite to save stuff etc but don't get how i can make would be like item 1 description of item 1 amount of item 1 etc.
  22. Wisin

    inventory system

    so... someone can help me to start making it?
  23. hey, i've started to make a zombie mode and i want to make an inventory system where you can use items/drop etc but i don't know where to start exactly, i mean like how i should save the items etc. if someone can tell me how i start i will be very greatefull.
  24. Wisin

    time

    ive done this with a timer and does a weird thing, joinTimes = { } function onJoin() joinTimes[source]=getTickCount() end addEventHandler("onPlayerJoin",getRootElement(),onJoin) function onlineTime(playerSource) local getTickStart = getTickCount () dana=tonumber(getTickStart) hours = math.floor(dana/3600) minutes = math.floor((dana-hours*3600)/60) seconds = math.floor(dana-hours*3600-minutes*60) retStr = tostring(tonumber(hours)).."h "..tostring(tonumber(minutes)).."min "..tostring(tonumber(seconds)).."s" setElementData(playerSource,"joinTime",retStr) return retStr end function timer(playerSource) setTimer(onlineTime, 50, 0, playerSource) end addCommandHandler ("m", timer) this is what it does: 1394H 20MINS 50SECS and starts to do lot and lots of hours...
×
×
  • Create New...