-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
addEventHandler ( 'onGamemodeMapStart', root, function ( uMapStart ) local mapname = getResourceName( uMapStart ) local xml = xmlLoadFile("data/ratings.xml") if ( xml ) then local index = findIndexByName ( mapname ) if ( index ) then local map = xmlFindChild ( xml, "map", index ) local rating = xmlNodeGetAttribute ( map, "rating" ) local ratedBy = xmlNodeGetAttribute ( map, "ratedBy" ) local played = xmlNodeGetAttribute ( map, "played" ) outputChatBox ( "rated: ".. rating .." ratedBy: ".. ratedBy .." played ".. played, getRootElement(), 255, 0, 0, true ) else outputChatBox ( "Map not found in our ratings list.", getRootElement(), 255, 0, 0, true ) end else outputChatBox ( "Unable to load map ratings XML file.", getRootElement(), 255, 0, 0, true ) end end ) function findIndexByName ( mapName ) local ratingsFile = xmlLoadFile("data/ratings.xml") if ( ratingsFile ) then for index, map in ipairs ( xmlNodeGetChildren ( ratingsFile ) ) do local name = xmlNodeGetAttribute ( map, "id" ) if ( name == mapName ) then return index -1 end end xmlUnloadFile(ratingsFile) end end I tested it and it works.
-
I was wondering the same Dakilla, how did it reach 1028 if the max players is 1024?
-
Talvez the olvidaste de borrar el "end" tambien.
-
@Blazy: Use triggerServerEvent to give the money, because if you give it client side it won't sync it.
-
You may also want to disable the stealth kills with the Knife, you can cancel the event onClientPlayerStealthKill if the weapon is the Knife.
-
function soundPlay ( command ) -- Command handlers client side has no player argument. sound = playSound ( "files/mission.mp3", false ) setSoundVolume ( sound, 1.0 ) end addCommandHandler ( "sound", soundPlay ) -- change the command into whatever you want.
-
Indeed, they mayn't support them, but you can always use guiCreateFont and then have that font.
-
Para que ponerle 300? para eso borras o desactivas esa parte del script y listo. Esta en "s_main.lua", este es el codigo que tenes que borrar/desactivar: if ( ( plrTeam ) and ( plrTeam ~= class.team ) and ( countPlayersInTeam( plrTeam ) == 1 ) ) then destroyElement( plrTeam ); end
-
May I ask what the hell is "onClientResourceRoot"? that event doesn't exists, nor makes any sense.
-
That's because every time you join, you download the client side resources and that triggers "onClientResourceStart".
-
Esta mal, bindKey client side no tiene argumento de jugador, ademas en el evento de onClientMarkerHit/Leave pusiste: "player()", pero ahi deberia ir un elemento de un marker. function bindTheKeys ( ) bindKey ( "M", "down", cañon ) end addEventHandler ( "onClientMarkerHit", root, bindTheKeys ) function unbindTheKeys ( ) unbindKey ( "M", "down", cañon ) end addEventHandler ( "onClientMarkerLeave", root, unbindTheKeys ) No estoy seguro si te va a permitir usar "ñ".
-
function soundPlay ( ) sound = playSound ("files/mission.mp3", false ) setSoundVolume ( sound, 1.0 ) end addEventHandler ( "onClientResourceStart", resourceRoot, soundPlay )
-
La verdad me estoy aburriendo de que postes un codigo y "que esta mal ?" sin decirnos si tenes errores o que deberia hacer el script.
-
Oh, fue mi error, tendria que haber leido el resto del tema .
-
El evento "onSpawnSlothBot" seguro se ejecuta cuando un bot spawnea, entonces vos estas creando los bots cuando otro bot spawnea. P.D: Para usar un evento creado por el script tambien tenes que usar addEvent.
-
Estan spawneando los zombies cuando ellos spawnean? no tienen mucho sentido eso para mi.
-
De nada.
-
Estan en: "\server\mods\deathmatch\interval.db" Podes abrir el archivo con el programa: SQLitebrowser.
-
You shouldn't say someone else code is wrong when you haven't even tested it.
-
He's talking about private spawns, e.g: I spawn on Los Santos, you spawn on Las Venturas, and so on, different spawn points for each player.
-
It's not wrong, but yours is wrong. I clicked on "Rules" button and it didn't load the text from the XML file.
-
-- script: local Rules = xmlLoadFile ( "xml/rules.xml" ) local Ruless = xmlNodeGetValue ( Rules ) window = guiCreateWindow(462,275,716,474,"",false) Rules = guiCreateButton(13,76,82,35,"Rules",false,window) memo = guiCreateMemo(117,29,582,386,"",false,window) function buttonClick ( button ) if ( button ~= "left" ) then return end if ( source == Rules ) then guiSetText ( memo, tostring ( Ruless ) ) end end addEventHandler ( "onClientGUIClick", resourceRoot, buttonClick ) -- rules.xml My rules here
-
Lo unico que tenes que hacer es iniciar XAMPP y luego iniciar "MySQL" y "Apache", luego vas tu navegador y pones "localhost" y clickeas en "phpMyAdmin", ahi creas tus bases de datos y luego usas los datos para conectarte en MTA.
