A Cs2D clan
 
HomeFAQSearchMemberlistUsergroupsRegisterLog in

Share | 
 

 wrapper - lua

Go down 
AuthorMessage
M&M3

avatar

Posts : 348
Join date : 2010-12-22
Age : 26
Location : Austria

PostSubject: wrapper - lua   Sat Dec 25, 2010 11:34 pm

-- Kill a player
function killplayer(id)
parse("killplayer "..id)
end

-- Spawn a player at a certain position
function spawnplayer(id,x,y)
parse("spawnplayer "..id.." "..x.." "..y)
end

-- Set a player to a certain position
function setpos(id,x,y)
parse("setpos "..id.." "..x.." "..y)
end

-- Set money
function setmoney(id,money)
parse("setmoney "..id.." "..money)
end

-- Set health
function sethealth(id,health)
parse("sethealth "..id.." "..health)
end

-- Set maximum health
function setmaxhealth(id,maxhealth)
parse("setmaxhealth "..id.." "..maxhealth)
end

-- Set armor
function setarmor(id,armor)
parse("setarmor "..id.." "..armor)
end

-- Set score
function setscore(id,score)
parse("setscore "..id.." "..score)
end

-- Set deaths
function setdeaths(id,deaths)
parse("setdeaths "..id.." "..deaths)
end

-- Equip a player with an item
function equip(id,itemtype)
parse("equip "..id.." "..itemtype)
end

-- Remove an item from a player
function strip(id,itemtype)
parse("strip "..id.." "..itemtype)
end

-- Modify speed of a player
function speedmod(id,value)
parse("speedmod "..id.." "..value)
end

-- Spawn item on map
function spawnitem(itemtype,x,y)
parse("spawnitem "..itemtype.." "..x.." "..y)
end

-- Remove item from map
function removeitem(itemid)
parse("removeitem "..itemid)
end

-- Trigger entities
function trigger(name)
parse("trigger "..name)
end

-- Wrapper functions for easy usage of CS2D commands in Lua --
-- 08.03.2009 - www.UnrealSoftware.de --

-- These functions make it easier to use CS2D commands in Lua --
-- They call the parse functions with the fitting parameters --
-- --
-- Example without wrapper function: --
-- parse("spawnplayer "..id.." "..x.." " ..y) --
-- --
-- Example with wrapper function: --
-- spawnplayer(id,x,y) --
-- --
-- Both examples do exactly the same but using the wrapper --
-- function is much easier and not as error-prone as using parse.--
-- Therefore it is recommended to use the wrapper functions. --
-- --
-- Use the following line to include the wrapper in your script: --
-- if wrapper~=TRUE then dofile("sys/lua/wrapper.lua") end --

Back to top Go down
View user profile
 
wrapper - lua
Back to top 
Page 1 of 1
 Similar topics
-
» Forex gains buoy banks

Permissions in this forum:You cannot reply to topics in this forum
Team Fruit|Fruit| :: GFX ,SFX area :: Lua and binds-
Jump to: