Forum

> > CS2D > Scripts > *Fixed Combining 2scripts
Forums overviewCS2D overview Scripts overviewLog in to reply

English *Fixed Combining 2scripts

3 replies
To the start Previous 1 Next To the start

old *Fixed Combining 2scripts

apex2d
User Off Offline

Quote
im doing a project
i want this 2script going to be mixed!

i am a noob but i know basics ( i guess ) maybe codes will make me very pleased

im combining scripts from
http://www.unrealsoftware.de/files_show.php?file=16711
and
http://www.unrealsoftware.de/files_show.php?file=14215
(alternate download)
http://www.mediafire.com/download/2wercx28jof10uk/system_level_rank_mod.zip

the thing i want is
Quote
if my rank is "Noob" it will show Peasant I rank, if i ranked up it will become Peasant II, and it will be silver 1 silver 2 blah2...



(fk grammar)

Point: Uprank = image changes to the desire rank

Here's the code for you guys who can't download

Spoiler >


Spoiler >


The code isn't by me, Originally created by M_ and Yates

Edit: i fixed the codes but this is the thing i can't fix...
"LUA ERROR: image - can't load image at '..levelimage.."
Edit: Done fixed :3
edited 10×, last 18.01.16 12:07:29 pm

old Re: *Fixed Combining 2scripts

Rainoth
Moderator Off Offline

Quote
You can wait for user Yates to post a code on how he handled it in his private mod or you can do it this way.
Assign each symbol into a table (1 is shitty img, 2 is better, 3 is even better and so on), then put images as placing image on player with say img[player_level] (replace the variables here).

old Re: *Fixed Combining 2scripts

GeoB99
Moderator Off Offline

Quote
Strangely, I am not able to open the second file, it seems broken for me (even the alternative link doesn't work for me as well). So, I may try to help you in a guessing way.

Try to search for a line on those files that has player.rank[id] or something like that's related with the rank levels. Most of these lines have an if statement which checks if either a specific player has the respective rank or reached it. If you found it, edit it with the following lines below.
1
2
3
4
if player.rank[id] >= 1 then
	image("gfx/yates/ranks/rank1_bronze.png", 0, 0, id+132)
	Image = nil
end
As you can see, I've used cs2d lua cmd image to show the image rank. >= 1 means it starts first with the first level rank, therefor it's "Noob" according to that script so we have to use the bronze rank image and going further with other ranks image based upon the rank level. In third line, Image is a table which is defined to nil because CS2D recycles image IDs and whenever we reach another rank, the predecessor rank image is gone but the ID itself not thus leading to a bug, so we have to remove the image ID recycled manually. With that said, in the beginning of the code, write Image = {} and let it with empty brackets!

NOTE: In the code that I've posted, it's only an example one because I am not simply able to open the files. So your main focus is to check carefully if in the line it's player.rank[id] or level[id] or something else.

Do that for every line until you're done with the last rank level. Hope that helps somehow.

old Re: *Fixed Combining 2scripts

Rainoth
Moderator Off Offline

Quote
Stop pushing the thread.
Put codes into code tags.
Your error says that 'id' doesn't exist in the spot where you're trying to use it (the spot is given too).
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview