Jump to content

Function:spawnAllPlayers with Exceptions - War OF Empire -


laserlaser

Recommended Posts

Posted

Hello,this my new function.Really good,and easy.Something useful.

Ex use:

spawnAllPlayers(x,y,z,"Bikers","laserlaser") 
((( Here, it just does not respawn player "Bikers" and player "laserlaser" ))) 

spawnAllPlayers(x,y,z,[string playerNames ...]) 

The Function:

function spawnAllPlayer(x,y,z,...) 
    local ex = {...} 
    local players = getElementsByType("player") 
    local exPlayer = 0 
    for k,v in ipairs(players) do 
        exPlayer = 0 
        for a,c in ipairs(ex) do 
            if tostring(getPlayerName(v)) == tostring(c) then 
                exPlayer=1 
            end 
        end 
        if exPlayer ~=1 then 
            spawnPlayer(v,x,y,z) 
        end 
    end 
end 

- War Of Empire LUA Team -

Posted

could you please add all of these functions to the wiki instead of posing them here?

it will be MUCH better :)

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

not much longer, but MUCH more helpful. On Scripting section there are people looking for help with their scripts instead of general advices (and they don't search anyway -.-). On wiki - there are scripters that like examples, useful functions. They will search and they can read.

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted
could you please add all of these functions to the wiki instead of posing them here?

it will be MUCH better :)

you do realise that it is the same function with 2 loops that he exploits over and over and for any purpose (remove accounts, respawn cars, now players)?

honestly, i wouldnt want to see this kind of code on the wiki. dude doesnt even know about booleans.

?

Posted

better wiki than here.

putting this in useful functions (NOT in client/server function list as these aren't build-in functions) won't hurt so much

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted
better wiki than here.

putting this in useful functions (NOT in client/server function list as these aren't build-in functions) won't hurt so much

Better here than wiki or resources. The useful functions page contains what it says, a list of functions that are useful. This is just a simple snippet that 99.99% of scripters won't ever need, and if they do need it for whatever reason, it's so simple that they can probably do it by themselves.

No offense to the creator, it's nice of you sharing your scripts but maybe you should try and write stuff that are more general or that address very common problems.

:d::i::s::g::r::a::c::e:

norby89.png

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...