Jump to content

GhostXoP

Members
  • Posts

    402
  • Joined

  • Last visited

Everything posted by GhostXoP

  1. And Now, since you have made it public that it was you and your server attempting to copyright Everyone will know who to come after when you make it.
  2. Alright kids, the question was already answered. Find something else to do
  3. In the Optional Argument Does that mean, when the client scripts try to check the elements data, it will be the same there as it is on the server?
  4. I assume vehicle is a pointer to memory on the host its created on, that's what is causing this limit
  5. function SpawnPlayerInCar(Vehicle) warpPedIntoVehicle(source,Vehicle) end addEvent("Server,PutMeInMyCar", true) addEventHandler("Server.PutMeInMyCar", getRootElement(), SpawnPlayerInCar) SERVERSIDE --spawn the vehicle where player is but spawn player within it local x,y,z = getElementPosition(getLocalPlayer()) local spawnedVehicle = createVehicle(Item.ID, x,y,z, 0, 0, 0, Item.LIC) triggerServerEvent("Server.PutMeInMyCar", getLocalPlayer(), spawnedVehicle) CLIENTSIDE
  6. That is the odd part, and its odd only because i get no errors via debugscript 3 or in the console
  7. I have tried to use warpPedIntoVehicle(source, VEHICLE) and this does not seem to be working How can i spawn the player into a vehicle otherwise?(This is server side within an event handler triggered by the player)
  8. Is there a way to tell if a function triggered an event? addEventHandler("onClientPlayerWeaponSwitch",giveWeapon,cancelEvent) addEventHandler("onClientPlayerWeaponSwitch",takeWeapon,cancelEvent) ?
  9. Yours basically stores in blocks, using json right? Because its exactly what mine does, and mine does everything correctly, stand by and ill have pictures -- See, it works. I fromJSON the string, and send it to the client, the client gets the array and then it says the variables ammo and id within the array [22] within Weapons does not exist. Why is this? Its right there in the string, in good format, isn't it?
  10. I had printed the data out to debug and it is all intact! it looks exactly as it should before JSONing it, but when i do, it says the sub array Weapons does not contain a --, it says its nil. Is there a chance fromJSON isnt completely creating the array?
  11. -- No. I already wrote my version, if i didn't, i wouldn't be here. The data DOES SAVE, I get -- EXAMPLE HelloWorld, I am not Human <- as it should be HelloWorld rld, I am not Human. this is just an example of how it comes out, over lapped. My bottom code retrieving the blocks, do as they should and retrieve in order but, it comes out over lapped. (Which means Look at Retrieval code) In a nut shell, --, turn the string into an array, then return it. Its returning it over lapped. This is not the fault of my save code, because i have showing (in the image) proof that it saved correctly, with the correct key number order.
  12. I've decided on rewriting a version of MTA's set/getAccountData procedure to take Arrays, for now i have this. Would you like the source?
  13. When retrieving a string from a key using getAccountData is just the string retrieved? HelloWorld and not HelloWorldDATAUSEDFORMTA Does it return the exact data, like when placed there in the first place?
  14. This is a Server Side Script A couple days ago i had posted about how i went to json a string, and it had turned out to only partially save using setAccountData because of the limits that MTA has set. I have a temporary fix (it works, for what it does) that fragments your long string, and saves it, and can reopen it. You can now save giant arrays to users accounts. This brings me back to the days when i had written a FAT file system driver (In assembler..), with end of file markers in the fat entries. FRAGMENTS ARE NOT DELETED! THEY ARE REUSED function SaveAccountData(Account, Array, Key) -- Player Account, Array to be saved, Key string to be saved under --turn it into string local ArrayString = toJSON(Array) --get its length local ArrayStringLen = string.len(ArrayString) local BlockNum = 1 local StrPos = 1 local StrEnd = 0 while ArrayStringLen ~= 0 do if ArrayStringLen < 64 then -- this is the last --pos = endd POS ALREADY SET StrEnd = StrEnd + ArrayStringLen ArrayStringLen = 0 setAccountData(Account, Key..tostring(BlockNum), string.sub(ArrayString,StrPos,StrEnd).."|\END/|") -- len -6 gets string (removing tag) break end StrEnd = StrEnd + 64 setAccountData(Account,Key..tostring(BlockNum), string.sub(ArrayString,StrPos,StrEnd)) StrPos = StrEnd+1 BlockNum = BlockNum + 1 ArrayStringLen = ArrayStringLen - 64 end end --done --Returns giant array function RetrieveAccountData(Account,Key) --Account, Key string it was saved under local ArrayString = "" local BlockNum = 1 while 1 == 1 do ArrayString = ArrayString..getAccountData(Account, Key..tostring(BlockNum)) --do we have the end of string tag? if so remove dat b and gtfo if string.sub(ArrayString,string.len(ArrayString)-5,string.len(ArrayString)) == "|\END/|" then ArrayString = string.sub(ArrayString,1,string.len(ArrayString)-6) break end BlockNum = BlockNum + 1 end return fromJSON(ArrayString) end I don't really care what you do with it, call it your own whatever. Its only a couple lines of code Hope this solves problems! I had to write it mainly because it was this, or i throw away my little 6kloc brief case resource, and i really didn't want to redo it..
  15. Thank you. That explains its purpose.
  16. Exactly. Is the Password argument in getAccount Optional or not.
  17. English isn't your main language i assume, which is fine as long as you understand what i'm getting at. Ok How about this getAccount SERVERSIDE (as its only available serverside -.-) It says password is optional, but required. It says if its not specified i can still get the account whatever the password is. otherwise the password must match the account. That makes no sense what so ever. Is it optional toward the server or not.
  18. I can get the account easily. From the server, (My server, containing their passwords) how can i, The server, Not the Player, THE SERVER, get CLIENT passwords?
  19. There is a function for getting an accounts name, how can i get its password?
  20. Can i delete an account data value by doing setAccountData(Account, "String", nil) ?
  21. Nice catch, il be sure to write a function that stores giant json strings but fragmenting them so others on here wont have this problem. Thanks for the find
  22. Someone should figure this out and post it in the wiki
×
×
  • Create New...