Jump to content

ArmedGuy

Members
  • Posts

    17
  • Joined

  • Last visited

Everything posted by ArmedGuy

  1. I got a script that when a cop hits a marker a command gets avalible, and when he uses that command that command becomes unavalible... But when i use removeCommandHandler the server crashes and the game too, am im using it on the wrong place? Heres the code: function crimeCommit( playerSource,cmd,crime) local team = getPlayerTeam(playerSource) local teamname = getTeamName(team) if teamname =="SAPD" then if crime=="true" then givePlayerMoney(player, 5000) outputChatBox("Good, That Criminal Is No More, For your Cooperation The SAPD give you 5000 dollars!", player,0,255,0) --added the removeCommandHandler here end if crime=="false" then takePlayerMoney(player, tonumber(10000)) outputChatBox("Prank Calling The Police is NOT ALLOWED, you have now lost 10000 dollars!", player, 255,0,0) --added the removeCommandHandler here end end end this isent the whole code! but what may be the problem?
  2. Or what i did for my Taxi Menu lol, A simple edit box and a button, when you press that button the script gets the text from the box and searches if its in the script for a spawn. Thats pure simplyness(thats not even a real word ^^)
  3. A: For Breakfast Yes Q: Tomato Sauce and Mushrooms?
  4. Yeah, Try Releasing a Preview, like we can look at, but not touch lol ^^. Anyways im looking forward to this as it seems to be epiclly Awsomly Z'Uber Pwnage.
  5. Sorry for bumping, but, does the skin and money of a player get reset if you use the command spawnPlayer? as the script(which is a playerstats script loads the data sucessfully, also when the screens faded out, but then when i use a inbuilt command, /spawn, it goes back to regular CJ and no money
  6. Oh yea, I Finally got it working, and no idea why it didnt work before, even after i removed that source...
  7. Yeah, Its just a piece, but anyone want the whole code to try finding whats wrong? As i seriously cant find any problem.
  8. But when i remove that source i get this Error: Bad Argument @ "getClientName" Thats why i added that source. So anyone know?
  9. Yeah, so when someone logs in to their account i want to retrive their name/account name, but if i use this code: function onPlayerJoin ( source ) if ( saveFile ) then local sourcename = getClientName( source ) addEventHandler("onClientLogin", getRootElement(), onPlayerJoin) i get this error: ERROR: Line Blabla: Bad "Client" Pointer @ getClientName anyone know why?
  10. Well Alexander, depends what you gonna do with the coors. If you just gonna use them to put them into an script to for example spawn a car then you can use a .txt, or even easier just put the game in windowed, open admin panel, select urself and write the coors directly to the script. But If you gonna use a command like if you want to save a pos, then go to it later then xml is better.
  11. actually saving pos is better to an xml or map... i got a script thats working for this, i just gotta find it first lol
  12. there is no clientloginSuccess but there is a onClientLogin
  13. Yea 50p, i will use "onClientLogin" and "getAccountName"... And Also Ty, I got it working now i can finally work on my telephone too
  14. Hokay. Im Trying To Get A Script To Search For a Specific Subnode and Get The Attributes from it But as all the Subnodes have the same name i gotta make it loop through, and i have no idea how to do that. Heres The .lua(now it looks messed up as i tried to make something, didnt work thou) local saveFile = xmlLoadFile ("playerstats.xml") local statscheck = 0 local statssave = 0 function onPlayerQuit ( source ) xmlLoadFile ("playerstats.xml") outputChatBox( "Saving Data", source ) if ( saveFile ) then local subnode = xmlFindSubNode( saveFile, "users", 0 ) local playeraccount = getClientName ( source ) if ( playeraccount ) then local stats = xmlFindSubNode( subnode, "player", statssave ) local name = xmlNodeGetAttribute( stats ,"name") if ((stats) and (name ==""..playeraccount)) then local playermoney = getPlayerMoney ( source ) local playerskin = getPlayerSkin ( source ) local money = xmlNodeSetAttribute( stats, "money", playermoney ) local skin = xmlNodeSetAttribute( stats, "skin", playerskin ) xmlSaveFile ( saveFile ) else statssave = statssave + 1 end end else outputChatBox("File Not Found", source ) end end function onPlayerJoin ( source ) xmlLoadFile ("playerstats.xml") outputChatBox("Loading Acc...", source ) if ( saveFile ) then local playeraccount = getClientName ( source ) if ( playeraccount ) then local subnode = xmlFindSubNode ( saveFile, "users", 0 ) local stats = xmlFindSubNode ( subnode, "player", statscheck ) local name = xmlNodeGetAttribute( stats, "name" ) if (( stats ) and (name ==""..playeraccount)) then local playermoney = xmlNodeGetAttribute( stats, "money" ) local playerskin = xmlNodeGetAttribute( stats, "skin") if (( playermoney ) and ( playerskin )) then setPlayerMoney ( source, playermoney ) setPlayerSkin ( source, playerskin ) end else statscheck = statscheck +1 end else local stats = xmlCreateSubNode( subnode, "player" ) local name = xmlNodeSetAttribute( stats, "name", playeraccount ) xmlSaveFile ( saveFile ) end else outputChatBox("File Not Found", source ) end end addCommandHandler("loadaccount1", onPlayerJoin ) addCommandHandler ( "saveaccount1", onPlayerQuit ) function stoploading () xmlUnloadFile( saveFile ) end addEventHandler("onResourceStop", getResourceRootElement(getThisResource()), stoploading ) and heres the .xml that the lua should find from <playerstats> <users> <player name="Dudeinblack" money="99999999" skin="1337"/> <player name="ArmedGuy-JNRNS" money="100000" skin="197"/> <player name="Armadillo" money="1" skin="13" /> </users> </playerstats> Like for example, I Want The .lua to search the xml above for an Subnode with the attribute name="ArmedGuy-JNRNS"... and what i know, to do that the script gotta loop through every singe subnode named player until it finds one with the Attribute name="ArmedGuy-JNRNS"... I Would Like to get some help with this as i only need this working for my scripts to make them tun propertly Ty
  15. Nope... Gamesnert... When I Have The .xml complerly clean, like i have it here on the website, and start the resource everything works perfect. Players gets saved and loaded and all. But when the server/the resource gets restarted, its like the script thats saves and loads player data cant find the .xml with the data. And the only way to fix that is to delete all players data inside the xml and restart the server. And i have no clue why. And Argon... what version did u run it on?... i have DP 2.3( and also i dont have a getPlayerName inside the script, i have getClientName xDxD)
  16. Ok so Im Trying To Make a Script Where Players Data Gets Saved When They Leave Server and Their Data Gets Loaded When They login to an xml file... I Got The Whole Script Working Exept One Thing. When the server or the gamemode restarts the script cant find the xml file if something is saved in the playerstats.xml... heres the .lua local saveFile = xmlLoadFile ("playerstats.xml") function onPlayerQuit ( source ) outputChatBox( "Saving Data", source ) if ( saveFile ) then local subnode = xmlFindSubNode( saveFile, "users", 0 ) local playeraccount = getClientName ( source ) if ( playeraccount ) then local stats = xmlFindSubNode( subnode, "user."..playeraccount, 0 ) if ( stats ) then local subnodemoney = xmlFindSubNode( stats, "money", 0 ) local subnodeskin = xmlFindSubNode( stats, "skin", 0 ) local playermoney = getPlayerMoney ( source ) local playerskin = getPlayerSkin ( source ) local money = xmlNodeSetValue( subnodemoney, ""..playermoney ) local skin = xmlNodeSetValue( subnodeskin, ""..playerskin ) xmlSaveFile ( saveFile ) end end else outputChatBox("File Not Found", source ) end end function onPlayerJoin ( source ) outputChatBox("Loading Acc...", source ) if ( saveFile ) then local playeraccount = getClientName ( source ) if ( playeraccount ) then local subnode = xmlFindSubNode ( saveFile, "users", 0 ) local stats = xmlFindSubNode ( subnode, "user."..playeraccount, 0 ) if ( stats ) then local subnodemoney = xmlFindSubNode( stats, "money", 0 ) local subnodeskin = xmlFindSubNode( stats, "skin", 0 ) local playermoney = xmlNodeGetValue ( subnodemoney ) local playerskin = xmlNodeGetValue( subnodeskin ) if (( playermoney ) and ( playerskin )) then setPlayerMoney ( source, playermoney ) setPlayerSkin ( source, playerskin ) end else local stats = xmlCreateSubNode( subnode, "user."..playeraccount ) local subnode2 = xmlFindSubNode( subnode, "user."..playeraccount, 0 ) local playermoney = xmlCreateSubNode( subnode2, "money" ) local playerskin = xmlCreateSubNode ( subnode2, "skin" ) xmlSaveFile ( saveFile ) end end else outputChatBox("File Not Found", source ) end end addCommandHandler("loadacc", onPlayerJoin ) addCommandHandler ( "saveacc", onPlayerQuit ) and the .xml <playerstats> <users> </users> </playerstats> I seriously cant find the problem... and it dosent even give me errors someone know what the problem is?
  17. rofl ok.. here it is 1. swears = { ["fodido"]=true, ["puta"]=true, ["PUTA"]=true, ["puto"]=true, ["PUTO"]=true, ["ass"]=true, ["wanker"]=true, ["@"]=true, ["666"]=true, ["amina koyayim"]=true, ["asshole"]=true, ["bicha"]=true, ["bitch"]=true, ["cabron"]=true, ["carechimba"]=true, ["chinga"]=true, ["chupamela"]=true, ["cook"]=true, ["cunt"]=true, ["donkey"]=true, ["cum"]=true, ["estupido"]=true, ["foda"]=true, ["fuck"]=true, ["fuckers"]=true, ["fuckin"]=true, ["gay"]=true, ["gonorrea"]=true, ["guevon"]=true, ["hpd"]=true, ["hijueputa"]=true, ["hotmail"]=true, ["hps"]=true, ["ibne"]=true, ["maldita"]=true, ["maldito"]=true, ["malnarcido"]=true, ["malparido"]=true, ["marica"]=true, ["maricon"]=true, ["marik"]=true, ["marika"]=true, ["mierda"]=true, ["monda"]=true, ["msn"]=true, ["n00b"]=true, ["noob"]=true, ["orospu cocugu"]=true, ["pija"]=true, ["pirobo"]=true, ["pussy"]=true, ["retard"]=true, ["shit"]=true, ["sik"]=true, ["siktir"]=true, ["slut"]=true, ["twat"]=true, ["wanker"]=true, ["whore"]=true, ["wtf"]=true } function chat() if outputChatBox ==(swears) and getElementType(source)=="player" then outputChatBox ("PLEASE DONT SWEAR ON NRNS SERVERS!!!!... U CAN GET KICKED/BANNED", 255, 0, 0 ) end end addEventHandler ("onPlayerChat",source, chat ) this gives the WARNING arris was talking about but.. i made another one that may me abit better swears = { ["fodido"]=true, ["puta"]=true, ["PUTA"]=true, ["puto"]=true, ["PUTO"]=true, ["ass"]=true, ["wanker"]=true, ["@"]=true, ["666"]=true, ["amina koyayim"]=true, ["asshole"]=true, ["bicha"]=true, ["bitch"]=true, ["cabron"]=true, ["carechimba"]=true, ["chinga"]=true, ["chupamela"]=true, ["cook"]=true, ["cunt"]=true, ["donkey"]=true, ["cum"]=true, ["estupido"]=true, ["foda"]=true, ["fuck"]=true, ["fuckers"]=true, ["fuckin"]=true, ["gay"]=true, ["gonorrea"]=true, ["guevon"]=true, ["hpd"]=true, ["hijueputa"]=true, ["hotmail"]=true, ["hps"]=true, ["ibne"]=true, ["maldita"]=true, ["maldito"]=true, ["malnarcido"]=true, ["malparido"]=true, ["marica"]=true, ["maricon"]=true, ["marik"]=true, ["marika"]=true, ["mierda"]=true, ["monda"]=true, ["msn"]=true, ["n00b"]=true, ["noob"]=true, ["orospu cocugu"]=true, ["pija"]=true, ["pirobo"]=true, ["pussy"]=true, ["retard"]=true, ["shit"]=true, ["sik"]=true, ["siktir"]=true, ["slut"]=true, ["twat"]=true, ["wanker"]=true, ["whore"]=true, ["wtf"]=true } function chat_bad(message, messageType) if message ==(swears) and getElementType(source)=="player" then outputChatBox ("PLEASE DONT SWEAR ON NRNS SERVERS!!!!... U CAN GET KICKED/BANNED, 255, 0, 0 ) end end addEventHandler ("onPlayerChat", getElementRoot(), chat_bad ) thou i havent debugged the latest one lol... its 2 Am here... been scripting for 13 hours today rofl
  18. ahhh... Robohol, i was the one that made that script with arris and we wrote (All Swears Here) Because we didnt want to have a awsomly long text just with swearing. And all words are written like this: swears = { ["Swear"]=true, ["swear"]=true, and so on... Just so u know And that outputChatBox string, thats just temporary So dont worry about that. But The Thing We Gotta Get Fixed Is That Warning. And Right Now We Have No Clue What To Do. And Also We Just Gotta Get It Working Right Now.. Then We Can Fix The Swearings.
×
×
  • Create New...