-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
If it's the same script, then that error shouldn't happen.
-
And, is it in the same script? because that function is defined as local, so it won't exist outside that file.
-
Have you defined it?
-
Ese recurso no es publico, tendrias que crearlo vos mismo.
-
ZombieCap = {} function ZombieToEnemy(Player) local ZombieTeam = getPlayersInTeam( ZombieArena ) local RandomPlayer = getRandomPlayer( ZombieTeam ) if ( not ZombieCap[RandomPlayer] ) then ZombieCap[RandomPlayer] = 0 end local thePlayer = getPlayerName( RandomPlayer ) local IsEnemy = getPlayerTeam( RandomPlayer ) if not getAccountData( thePlayer, ZombiesKilled ) then outputChatBox("Welcome to the Zombie Arena, each zombie killed will give you $500", source) outputChatBox("If you recived this message it means its your first time in the Zombie Arena", source) outputChatBox("This also means there's a Zombie spawning near you. You can spend the money in the lobby", source) setAccountData( thePlayer, ZombiesKilled, 0) else outputChatBox("a zombie spawned near you, warning!", source) end if not ZombieCap[RandomPlayer] > 20 then if IsEnemy == ZombieArena then ZombieCap[RandomPlayer] = tonumber(ZombieCap[RandomPlayer])+1 local X,Y,Z = getElementPosition( RandomPlayer ) local Rot = getElementRotation( RandomPlayer ) spawnBot( tonumber(X)+10, tonumber(Y)+10, tonumber(Z), tonumber(Rot), 10, 0, 0, nil, 0, "chasing", thePlayer) else outputChatBox("".. thePlayer .." is not into ZombieArena team, Zombie spawning failed!") end else outputChatBox("" .. thePlayer .." has reached the cap of Zombies allowed!") end end setTimer( ZombieToEnemy, 1000, 0) function ZombieKilled(attacker, weapon, bodypart) local thePlayer = getPlayerName( attacker ) if ( not ZombieCap[attacker] ) then ZombieCap[attacker] = 0 end ZombieCap[attacker] = tonumber(ZombieCap[attacker])-1 local account = getPlayerAccount( thePlayer ) local money = getPlayerMoney( thePlayer ) local KilledZombies = getAccountData( account, ZombiesKilled) setPlayerMoney( tonumber(money)+500 ) setAccountData( account, ZombiesKilled, tonumber(KilledZombies)+1) outputChatBox("".. thePlayer .." has killed a zombie and $500 were added to his account!") end addEventHandler("onBotWasted", getRootElement(), ZombieKilled)
-
ZombieCap = {} function ZombieToEnemy(Player) if ( not ZombieCap[Player] ) then ZombieCap[Player] = 0 end local ZombieTeam = getPlayersInTeam( ZombieArena ) local RandomPlayer = getRandomPlayer( ZombieTeam ) local thePlayer = getPlayerName( RandomPlayer ) local IsEnemy = getPlayerTeam( Player ) if not getAccountData( thePlayer, ZombiesKilled ) then outputChatBox("Welcome to the Zombie Arena, each zombie killed will give you $500", source) outputChatBox("If you recived this message it means its your first time in the Zombie Arena", source) outputChatBox("This also means there's a Zombie spawning near you. You can spend the money in the lobby", source) setAccountData( thePlayer, ZombiesKilled, 0) else outputChatBox("a zombie spawned near you, warning!", source) end if not ZombieCap[Player] > 20 then if IsEnemy == ZombieArena then ZombieCap[Player] = tonumber(ZombieCap[Player])+1 local X,Y,Z = getElementPosition( Player ) local Rot = getElementRotation( Player ) spawnBot( tonumber(X)+10, tonumber(Y)+10, tonumber(Z), tonumber(Rot), 10, 0, 0, nil, 0, "chasing", thePlayer) else outputChatBox("".. thePlayer .." is not into ZombieArena team, Zombie spawning failed!") end else outputChatBox("" .. thePlayer .." has reached the cap of Zombies allowed!") end end setTimer( ZombieToEnemy, 1000, 0) function ZombieKilled(attacker, weapon, bodypart) local thePlayer = getPlayerName( attacker ) if ( not ZombieCap[attacker] ) then ZombieCap[attacker] = 0 end ZombieCap[attacker] = tonumber(ZombieCap[attacker])-1 local account = getPlayerAccount( thePlayer ) local money = getPlayerMoney( thePlayer ) local KilledZombies = getAccountData( account, ZombiesKilled) setPlayerMoney( tonumber(money)+500 ) setAccountData( account, ZombiesKilled, tonumber(KilledZombies)+1) outputChatBox("".. thePlayer .." has killed a zombie and $500 were added to his account!") end addEventHandler("onBotWasted", getRootElement(), ZombieKilled) Try that.
-
Do you have the extension file which the editor adds to your map? is a lua script.
-
Muy lindo el diseño .
-
getPedTotalAmmo returns all the ammo, including clip ammo.
-
Maybe you have two scripts saving/loading the weapons?
-
Yeah, I guess so, if it's the same code but different names, then it should work.
-
This isn't a request forum, if you want this, you must either learn to make it by yourself, or pay someone to do it for you.
-
This still makes no sense, could you please tell me what are you trying to do?
-
You're welcome.
-
What are you trying to do?
-
addEventHandler ( "onResourceStart", resourceRoot, function ( ) local xml = xmlLoadFile ( "ZombieArena.map" ) local Mapnode = xmlNodeGetChildren ( xml ) g_Objects = { } for _, node in ipairs ( Mapnode ) do local attrs = xmlNodeGetAttributes ( node ) table.insert ( g_Objects, { attrs.model, attrs.scale, attrs.posX, attrs.posY, attrs.rotX, attrs.rotY, attrs.rotZ } ) end end ) function CreateZombieArena ( ) for index = 1, #g_Objects do local ob = g_Objects [ index ] local object = createObject ( tonumber ( ob [ 1 ] ), tonumber ( ob [ 3 ] ), tonumber ( ob [ 4 ] ), tonumber ( ob [ 5 ] ), tonumber ( ob [ 6 ] ), tonumber ( ob [ 7 ] ), tonumber ( ob [ 8 ] ), false ) setElementDimension ( object, 50 ) setObjectScale ( object, ob [ 2 ] ) end end addEventHandler ( "LoadZombieArena", getRootElement(), CreateZombieArena )
-
No offense, but that's a mess, it doesn't make any sense.
-
No, start from 0, and loop all the children using the function I gave you.
-
Well, yeah, you can do it with setAccountData and getAccountData to check if it's set.
-
You must loop all the children in it. Use: xmlNodeGetChildren
-
Ok, good to hear. You're welcome.
-
Did you get it working?