注册 | 登录

游侠NETSHOW论坛





游侠NETSHOW论坛 游侠NETSHOW论坛 侠盗猎车系列MOD讨论区 代码往什么地方添加的?
查看: 1736|回复: 0
打印 上一主题 下一主题

[求助] 代码往什么地方添加的? [复制链接]

帖子
91
精华
0
积分
46
金钱
534
荣誉
0
人气
0
评议
0
跳转到指定楼层
楼主
发表于 2008-9-11 13:54:42 |只看该作者 |正序浏览
在国外的网站看到个“MOD”但是他说是要自己加代码。。。无奈本人是“小白”实在不明白他的意思,特来求助~!

这是原贴的描述。。不知道是说MOD还是说效果...

It's good that you're not afraid to use gosubs, but I think maybe you're not sure how they are used. Your first one (SubPlayerControl) is only called upon once. Worse, it loops with a wait even when there's a wait just before the subroutine. ANY time code is called upon only once, there's no gain in making it a subroutine. The other thing I noticed is that both of these commands  

...weigh seven bytes. Substituting one for the other gains nothing. In fact, using a subroutine JUST for that command is not only two bytes heavier because of the return command, but the computer needs to set the gosub variable, jump to that address, run the command, and return. Instead of JUST running the command. Since all of your subroutines are either only used once or weigh the same as the code they replace but with more overhead, there's no benefit to having subroutines in this thread. In fact, cutting them out would not only save you the overhead and the two bytes for the one return command, but you could also save the seven bytes of setting $key to equal 17. Which should be a local var anyways.

Other than that, this is a really cool idea. And your code is well commented  I would've made the trigger different. Only other tip I have is that you should be checking if player defined before addressing the player at all. In fact, doing this replaces the need for checking if wasted and if busted. Incorporate all of these ideas and here's what the code would look like

Insert this in your script

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

手机版|Archiver|游侠NETSHOW论坛 ( 苏ICP备2023007791号 )

GMT+8, 2025-8-16 11:18 , Processed in 0.307890 second(s), 12 queries , Gzip On, Memcache On.

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

分享到