Jump to content

Cassandra

Members
  • Posts

    200
  • Joined

  • Last visited

Everything posted by Cassandra

  1. Do you know how to play world sound 3d?
  2. Sorry for bothering and asking questions repeatedly. Do you know how to disable a gta sound?
  3. Aaaahaaa. Silly mistake. Edit: Thanks it works now.
  4. Didn't worked. Here's the code. for k, v in pairs(getElementsByType("vehicle")) do addEventHandler("onVehicleEnter", v, function(player) setVehicleEngineState(v, getElementData(vehicle, "vehicle.engine")) end ) addEventHandler("onVehicleExit", v, function(player) setVehicleEngineState(v, getElementData(vehicle, "vehicle.engine")) end ) end
  5. Oooh thanks. Did knew that the setVehicleEngineState works with onVehicleEnter/Exit.
  6. Is there a way to disable the automated engine? If you enter a vehicle, the engine automatically starts and if you leave it stops.
  7. Why haven't you compressed the video? 7.65 GB are you serious?
  8. Oh my god what's the world coming to?
  9. Nice to see another GUI library. Creative work!
  10. Nevermind fixed it. The coordinates and the path was the problem.
  11. I don't know why but the image doesn't shows up. src="image\logo.png" /> register["imgLogo"] = guiCreateStaticImage(82, 22, 202, 184, "image\logo.png", true, register["main"]) All other things working perfectly.
  12. For example if I have a code like this. function doSomething() for 1, 1000000 do print("Did!") end end function doAnother() print("Did!") end doSomething() doAnother() Will it prints the doAnother first or wait for doSomething to complete then move onto doAnother?
  13. That's not true. ipairs is for indexed tables, it means every item (value) in the table has it's own number: 1 is the index of the first value 2 is the index ot the second's and so on. Example: local indexedTable = { 2, "something", 8239713, "asd" } -- it's is equal to this: local indexedTable2 = { [1] = 2, [2] = "something", [3] = 8239713, [4] = "asd" } --both pairs and ipairs will work in those tables: for i, v in ipairs( indexedTable ) do -- i is the index and v is it's value -- this does the same as above: for i, v in pairs( indexedTable ) do pairs is for not-indexed tables, where instead of the index number can be anthing (numbers or strings) and they can be the same too. --both pairs and ipairs will work in those tables: for i, v in ipairs( indexedTable ) do -- i is the index and v is it's value -- this does the same as above: for i, v in pairs( indexedTable ) do local table = { ["string"] = 2, [7] = "something", ["lua"] = 8239713, [2231] = "asd", ["lua"] = "i have no idea what to write here...", } -- ipairs won't work in this case. for k, v in pairs( indexedTable ) do -- for pairs instead of "i" I usually use "k" wich means key (of the value). -- so, k will be the key( e.g. "string" at the first in this example ) -- and v will be it's value Thanks a lot. Now I finally know the difference between them.
  14. Edit: What is the difference between ipairs and paris?
  15. Do you know how to do ENUMERATORS on LUA?
  16. I want to know the LUA knowledge of doing that. For example, multi-dimensional array and normal arrays which reference id and stuff. Thanks for your response.
  17. Does anyone know how to replicate this in MTA? enum fInfo { fName[40], fRanks[8] } new FactionInfo[MAX_FACTIONS][fInfo]; new bool:fCreated[MAX_FACTIONS]; stock FactionGetFreeSlot() { for(new i = 0; i < MAX_FACTIONS; i++) { if(!fCreated[i]) return i; } return -1; } stock FactionCreate(factionName[], factionRanks[]) { new factionid = FactionGetFreeSlot(); format(FactionInfo[factionid][fName], 40, factionName); //strcpy(FactionInfo[factionid][fName], factionName, 40); for(new i = 0; i < 8; i++) { FactionInfo[factionid][fRanks][i] = factionRanks[i]; } fCreated[factionid] = true; return factionid; } stock FactionLoad(factionID, file[]) { INI_ParseFile(file, "LoadFactionData", .bExtra = true, .extra = factionID); FactionCreate(FactionInfo[factionID][fName], FactionInfo[factionID][fRanks] ); } stock FactionLoadAll() { new index = 0; format(smallstrz, sizeof(smallstrz), #SERVER_NAME "/%s/%d.ini", FactionFolder, index); while(fexist(smallstrz)) { FactionLoad(index, smallstrz); index++; format(smallstrz, sizeof(smallstrz), #SERVER_NAME "/%s/%d.ini", FactionFolder, index); } printf("Factions Loaded: %d", index); } forward LoadFactionData(factionID, name[], value[]); public LoadFactionData(factionID, name[], value[]) { new rank_parse[165]; INI_String("name", FactionInfo[factionID][fName], 40); INI_String("ranks", rank_parse, 165); sscanf(rank_parse, "p<:>iiiiiiii", FactionInfo[factionID][fRanks][0], FactionInfo[factionID][fRanks][1], FactionInfo[factionID][fRanks][2], FactionInfo[factionID][fRanks][3], FactionInfo[factionID][fRanks][4], FactionInfo[factionID][fRanks][5], FactionInfo[factionID][fRanks][6], FactionInfo[factionID][fRanks][7] ); return 1; } stock FactionSave(factionID) { format(smallstrz, sizeof(smallstrz), #SERVER_NAME "/%s/%d.ini", FactionFolder, factionID); new INI:file = INI_Open(smallstrz); new rank_parse[165]; format(rank_parse, sizeof(rank_parse), "%s", FactionInfo[factionID][fRanks][0]); for(new i = 1; i < 8; i++) { format(rank_parse, sizeof(rank_parse), ":%s", FactionInfo[factionID][fRanks][i]); } INI_WriteString(file, "name", FactionInfo[factionID][fName]); INI_WriteString(file, "ranks", rank_parse); INI_Close(file); } stock FactionSaveAll() { new index = 0; for(new i = 0; i < MAX_FACTIONS; i++) { if(fCreated[i]) { FactionSave(index); index++; } } printf("Factions Saved: %d", index); }
  18. Cassandra

    [Report]&HELP

    Use relative positioning system.
  19. Good discovery. So much surprising stuffs can be done using shaders.
  20. Also mention the steps for non-module MySQL. Good work!
×
×
  • Create New...