Forum

> > CS2D > Scripts > Parse Advice Please.
Forums overviewCS2D overview Scripts overviewLog in to reply

English Parse Advice Please.

6 replies
To the start Previous 1 Next To the start

old Parse Advice Please.

HeX
User Off Offline

Quote
Would anyone be able to offer me advice how to set parse("speedmod "..p.." 100") so i can choose the speed instead of the preset "100" i had made.

Also With
parse("equip "..p.."..weaponid") this current code line just says the message and doesn't give a weapon.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
elseif string.sub(txt, 1, 9) == "@speedmod" then
        if PlayerLevel(id) >= 25 then
            local p = tonumber(string.match(txt, "@speedmod (%d+)"))
            if (p ~= nil) and (player(p,"exists")) then
                parse("speedmod "..p.." 100")
                msg2(p,"©255125000"..player(id,"name").." has used speedmod on you.")
                msg2(id,"©255125000You speedmod "..player(p,"name").." !")
                return 1
            else
                msg2(id,"©255000000[Error] @speedmod <ID> <100>")
                return 1
            end
        else
            msg2(id,"©255000000You are not allowed to use this command!")
            return 1
        end

and equiping players..


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
elseif string.sub(txt, 1, 6) == "@equip" then
        if PlayerLevel(id) >= 25 then
            local p = tonumber(string.match(txt, "@equip (%d+)"))
            if (p ~= nil) and (player(p,"exists")) then
                parse("equip "..p.."..weaponid")
                msg2(p,"©255125000You have been equipped")
                msg2(id,"©255125000You equip "..player(p,"name").." !")
                return 1
            else
                msg2(id,"©255000000[Error] @equip <ID> <weaponid>")
                return 1
            end
        else
            msg2(id,"©255000000You are not allowed to use this command!")
            return 1
        end


Help would be nice

old Re: Parse Advice Please.

HeX
User Off Offline

Quote
Took a look at command proccessor, its not what i need haha
i believe i just need the parse short key..

example:
1
parse("speedmod "..p.." speed i want to set here.")

example:
1
parse("equip "..p.."..weapon id i want to equip")

example: "..spd"
example: "..wpn"

I would like to be able to change the speed and id everytime i use the command, get it?

I just cannot find the correct parse.

old Re: Parse Advice Please.

Flacko
User Off Offline

Quote
speed = 100
parse("speedmod "..id.." "..speed)
Then you have to figure out how and when you have to change the value of the 'speed' variable.

old Re: Parse Advice Please.

HeX
User Off Offline

Quote
i've tried
..speed
..spd
..x
..speedmod


none .-.



P.S ..id.. doesn't work ..p.. does.

old Re: Parse Advice Please.

omg
User Off Offline

Quote
you didnt get what flacko was saying...
use his line and replace speed with the other variable
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview