Jump to content

[HLF]Southclaw

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by [HLF]Southclaw

  1. I thought I was going a bit far with this, oh well, guess i'll start learning
  2. when i start my mta map editor [from the main menu] it says 'cannot load the race creator' what is the soloution to this problem? thanks in advance
  3. yeah i checked that already I just want a simple one i don't want someone else's script so i just want to make a simple one i made a code now but when i join the game it spawns me at tierer robada not the co-ords i set here is the code i made i'm a noob at this! addEventHandler("onResourceStart", resourceRoot, function() for i,player in ipairs(getElementsByType("player")) do JoinFunc(player) end end ) function JoinFunc(player) repeat until spawnPlayer ( player, -711+math.random(1,5), 957+math.random(5,9), 12.4, 90, math.random(9,288) ) fadeCamera(player, true) setCameraTarget(player, player) end function spawn(player) repeat until spawnPlayer ( player, -711+math.random(1,5), 957+math.random(5,9), 12.4, 90, math.random(9,288) ) fadeCamera(player, true) setCameraTarget(player, player) end addEventHandler("onPlayerJoin", root, function() JoinFunc(source) end ) addEventHandler("onPlayerWasted", root, function() setTimer(spawn, 1800, 1, source) end ) I removed everything form the resources folder so i just got 'resources/play/play.lua' and i edited that script, i'm missing something! thanks for help! All i want is 5 zombies to spawn when each player joins and for them to chase the player and when they die they just re spawn and start chasing again, is this a bit hard for starting off? i know exactly how to do it in PAWN but the only problem is that npcs are buggy [still in beta >]
  4. wow! thanks for that it's in now and i'm going to test, the code i got now is: function GameLoad () ped = createPed(0,0,0,10) local x,y,z = getElementPosition(player); local tx,ty,tz = getElementPosition(ped); setPedRotation(ped, findRotation(x,y,tx,ty) ); setPedAnimation(ped, "ped", "WALK_old", 0, 1, 1, 0) setTimer ( SetPedRot, 1000, 0, ped , player ) end addEventHandler ( "onResourceStart", getRootElement(), GameLoad ) function SetPedRot( ped , player) local x,y,z = getElementPosition(player); local tx,ty,tz = getElementPosition(ped); setPedRotation(ped, findRotation(x,y,tx,ty) ); end so i got a repeating time that sets the rotation of the ped to the player so the ped is following the player i'm making a zombie game just for fun as the npcs are a bit messed up on sa-mp
  5. I had a look at those 2 liunks and they are helpful thanks, but none of them are getting me closer to making a player face another, i think the main problem is that i don't understand the formula of the equasion so i can't get it, i will ask on sa-mp forum if someone can explain, people don't usually help though then just say 'search for it' or work it out yourself, i've already done that and i'm not the best at maths lol! anyway it would be great if someone could help me on this one! EDIT: This is what i made: function GameLoad () ped = createPed(0,0,0,10) local pX local pY local pZ local X local Y local Z local ang if ( Y > pY ) ang = (-math.acos((X - pX) / math.sqrt((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 90.0); else if( Y < pY && X < pX ) ang = ( math.acos((X - pX) / math.sqrt((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 450.0); else if( Y < pY ) ang = ( math.acos((X - pX) / math.sqrt((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 90.0); if(X > pX) ang = (math.abs(math.abs(ang) + 180.0)); else ang = (math.abs(ang) - 180.0); setPedRotation(ped1, ang) setPedAnimation(ped1, "ped", "WALK_old", 0, 1, 1, 0) end does it look like it would work?
  6. Hi, i recently started making a server i'm kinda getting to know the code [i'm used to PAWN ] and I just want to make a server for me and me friends, i want to make a player face another player, i have a formula from a sa-mp function and i want to put it in mta here it is: stock SetPlayerToFacePlayer(playerid, targetid) { new Float:pX, Float:pY, Float:pZ, Float:X, Float:Y, Float:Z, Float:ang; if(!IsPlayerConnected(playerid) || !IsPlayerConnected(targetid)) return 0; GetPlayerPos(targetid, X, Y, Z); GetPlayerPos(playerid, pX, pY, pZ); if ( Y > pY ) ang = (-acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 90.0); else if( Y < pY && X < pX ) ang = (acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 450.0); else if( Y < pY ) ang = (acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 90.0); if(X > pX) ang = (floatabs(floatabs(ang) + 180.0)); else ang = (floatabs(ang) - 180.0); SetPlayerFacingAngle(playerid, ang); return 0; }
×
×
  • Create New...