Jump to content

Alen141

Members
  • Posts

    105
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Alen141's Achievements

Punk-@ss B*tch

[email protected] B*tch (12/54)

1

Reputation

  1. Hey! Thanks for the reply! Well, gamemode complexity really is no issue.. ( I already have an rpg template I made for fun, works really well, but I do not intend to make an rpg [that template was more of a way to learn MTA documentation again, since I didn't use lua nor MTA functions in a long time..] ) the thing I'm worried about is player base and interest in something new or at least bit different approach on old gamemodes :S..
  2. So I've recently came back to MTA, nostalgia I guess, after cringing on my forum posts here, I was wondering maybe I should try and fulfill my childhood dream to have an mta server with my own gamemode, but I honestly don't even know if it's worth my time at this point.. So here I am asking a simple question.. Is it worth it? PS sorry if I posted in the wrong section
  3. Hey there I just wanted to know which functions do I need to use to create a door/gates that open only when certain team tries to enter( I don't want it to open using command )
  4. EDIT : idk if this will work, but maybe using theese, cause as I said not too good with xml nodes : xmlCreateFile xmlNodeSetAttribute
  5. not save it, but "make it" in XML, it makes things alot easier, after making code that allows you to create it in XML you can use alot simpler codes inside XML files as I mentioned before : "Police" position="x,y,z" skin="255" weapon(s)="31"
  6. you got my point, I've got this idea when checking XML in my spawn menu script
  7. Hey guys, I've been working on some simple job script lately but as I don't get xml nodes and stuff too much I can't make it easier for me to create jobs, if I would want to make another job I would have to do the same procedure again and again.. So what I wanted in my xml : <job name = ""(this would be elemnt data that would set "Job") position=""(position of marker) weapons=""(weapon ids ) skin=""(skin he would get) description=""(i guess it's self explanatory) My Police Job scripts : client side : jobWnd = guiCreateWindow(422, 250, 511, 272, "Job GUI v0.1", false) guiWindowSetSizable(jobWnd, false) desc = guiCreateMemo(9, 20, 492, 117, "Description: ....", false, jobWnd) guiMemoSetReadOnly(desc, true) yesbtn = guiCreateButton(64, 215, 156, 47, "Take Job", false, jobWnd) nobtn = guiCreateButton(266, 215, 156, 47, "Cancel", false, jobWnd) quitbtn = guiCreateButton(168, 147, 156, 47, "Quit Job", false, jobWnd) guiSetVisible(jobWnd, false) local jobmarker = createMarker ( 1536.4000244141, -1662.8000488281, 12.5, "cylinder", 1.5, 100, 149, 237, 170 ) function SAPDjob(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then if not guiGetVisible(jobWnd) then guiSetVisible(jobWnd, true) showCursor(true) end end end addEventHandler("onClientMarkerHit", jobmarker, SAPDjob) function closeGUI() if (source == nobtn) then showCursor(false) guiSetVisible( jobWnd, false ) end end addEventHandler("onClientGUIClick",root,closeGUI) function takeJob() if ( source == yesbtn ) then triggerServerEvent("getJob", getLocalPlayer()) guiSetVisible(jobWnd,false) showCursor(false) end end addEventHandler("onClientGUIClick",root,takeJob) function quitJob() if ( source == quitbtn ) then triggerServerEvent("quitJob", getLocalPlayer()) guiSetVisible(jobWnd,false) showCursor(false) end end addEventHandler("onClientGUIClick",root,quitJob) server side : exports.Scoreboard:scoreboardAddColumn( "Job" ) function createCivTeam () Polteam = createTeam ("Police", 100, 149, 237) noTeam = createTeam ("Unemployed", 253, 208, 23) end addEventHandler ("onResourceStart", resourceRoot, createCivTeam) function joinTeam() local playerTeam = getPlayerTeam ( source ) if not playerTeam or playerTeam == noTeam then setPlayerTeam(source,Polteam) setPlayerNametagColor ( source, 100, 149, 237) setElementModel(source, 280) giveWeapon ( source, 3 ) giveWeapon ( source, 23, 200 ) giveWeapon ( source, 26, 200 ) setElementData ( source, "Job", "Officer" ) outputChatBox("#00FF00You are now employed as Police Officer!", getRootElement(), 255, 0, 0, true ) else outputChatBox ( "#FF0000You are already employed, quit your job first!", getRootElement(), 255, 0, 0, true ) end end addEvent("getJob", true) addEventHandler("getJob",root,joinTeam) function quitTeam() local playerTeam = getPlayerTeam ( source ) if (playerTeam == Polteam) then setPlayerTeam(source, noTeam) setPlayerNametagColor ( source, 253, 208, 23 ) setElementModel(source, 0) setElementData ( source, "Job", "Unemployed" ) takeAllWeapons ( source ) outputChatBox("#00FF00You are now Unemployed and all of your weapons were \"taken\"", getRootElement(), 255, 0, 0, true ) else outputChatBox("#FF0000You don't have this job so you can't quit!", getRootElement(), 255, 0, 0, true ) end end addEvent("quitJob", true) addEventHandler("quitJob",root,quitTeam) How to make shorter procedure of creating jobs ?
  8. Hey guys I don't need too much of help, but how to use getElementData to make something similar to this Vehicle lock : paramedic = createVehicle ( 416, 2037.95703125, -1424.1435546875, 17.071420669556 ) function lockMedic ( player, seat, jacked ) if ( source == paramedic ) then ---- I tried everything to define class ---- ---- but can't figure out problem + got no errors ---- if ( class ~= "Paramedic" ) then cancelEvent ( ) outputChatBox ( "Only Paramedics are allowed to use this vehicle!", player, 255, 0, 0, true ) end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), lockMedic ) Gangs(class) : function update() for k, v in ipairs(getElementsByType('player')) do local money = getPlayerMoney(v) setElementData(v,"Money",money ) end for g, v in ipairs(getElementsByType('player')) do local gang = getElementData(v,"spawnedAs") or "N/A" setElementData(v,"Class",gang ) end end setTimer(update, 100, 0)
  9. he probably failed at copy/paste
×
×
  • Create New...