Forum

> > CS2D > General > Classes Script
ForenübersichtCS2D-ÜbersichtGeneral-ÜbersichtEinloggen, um zu antworten

Englisch Classes Script

7 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Classes Script

DeathMatch Survivor
User Off Offline

Zitieren
I was making a new class script i'm finished doing the classes , when i tried it when i change my class i won't respawn , like other mods/script Help me please
Your reward is a cookie

alt Re: Classes Script

DeathMatch Survivor
User Off Offline

Zitieren
OK

Code:


----------Menu Open with F2-------
addhook("serveraction","class")
function class(id,actionbutton)
if (actionbutton==1) then
getaction1(id)
end
end
if sample==nil then sample={} end
classesopt={}

function initArray(m)
     local array = {}
     for i = 1, m do
          array[i]=0
     end
     return array
end
scriptclassmenu=initArray(32)
function scriptclassesmenu(id)
     menu(id,"Select your Class,Killer|AK+M4+Medic Armor,Pwner|AK+M4+Medic armor+Kevlar+Helm,Destroyer|RPG+Grenade Launcher+Medic Armor,Haxer|Secret")
end

----------------------------

addhook("team","classesopt")
function classesopt(id,team)
     if (team>0) then
          scriptclassesmenu(id)
     end
end

-----------------------------------------------------------------

addhook("menu","Classes")
function classesoptsel(id,menu,sel)
     if (menu=="SMD Classes") then
          if (sel>=0 and sel<=4) then
               scriptclassmenu[id]=sel
               if (player(id,"health")>0) then
                    parse('killplayer '..id)
               end
          end
     end
end
-------------Spawn only Melee------------
addhook("spawn","nowep")
function nowep(id)
return no
end
----------------------------------------------------
---------------------------
function getaction1(id)
menu(id,"SDM Classes,Pwner,Killer,Destroyer,Haxer,")
end
---------------------------
addhook("menu","menuaction")
function menuaction(id,m,b)
if m=="SDM Classes" then

------Pwner--------
if b==1 then
---Killer---
parse('equip '..id..' 32 ')
parse('equip '..id..' 82 ')
parse('equip '..id..' 30 ')
--------------------------------------
end
------Killer--------
if b==2 then
---Add Funtion's Here---
parse('equip '..id..' 34 ')
parse('equip '..id..' 30 ')
parse('equip '..id..' 59 ')
parse('equip '..id..' 82 ')
--------------------------------------
end
------destroyer--------
if b==3 then
---Add Function's Here---
parse('equip '..id..' 49 ')
parse('equip '..id..' 47 ')
parse('equip '..id..' 82 ')
--------------------------------------
end
------Haxer--------
if b==4 then
---Add Function's Here---
parse('equip '..id..' 20 ')
parse('equip '..id..' 21 ')
parse('equip '..id..' 22 ')
parse('setmaxhealth '..id..' 250 ')
parse('equip '..id..' 47 ')
parse('equip '..id..' 81 ')
parse('equip '..id..' 41 ')
parse('equip '..id..' 40 ')
parse('equip '..id..' 82 ')
--------------------------------------
end
------Selection 5--------
if b==5 then
---Add Function's Here---

--------------------------------------
-------Every Second Script-------
addhook("second","heal")
function heal(id)
----------Functions-------
parse('setmaxhealth '..id..' 5 ')
------------------------------------
end

end
end
end

alt Re: Classes Script

Bowlinghead
User Off Offline

Zitieren
At first:
use
1
[code][ /code]

Tags!


1. The second hook has no parameter!
1
2
addhook("second","heal")
function heal(id)

2. Missing 'end'
1
2
3
------Selection 5--------
if b==5 then
---Add Function's Here---

3. Return "no" ? Do it works (I dont know)
1
2
3
4
addhook("spawn","nowep")
function nowep(id)
return no
end

I dont checkt the whole code just parts...
I think there are more misstakes!

alt Re: Classes Script

Bowlinghead
User Off Offline

Zitieren
Use notepad++ because you can see immediatly if you forgot an end with it.
And it mark words like "if" blue... (Like ever lua editor)

alt Re: Classes Script

Kel9290
User Off Offline

Zitieren
Mehr >
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antwortenGeneral-ÜbersichtCS2D-ÜbersichtForenübersicht