Keeping speed
Hello! I have started learning scripting some time ago, but I never really tried scripting stuff from scratch. Well, the last few days I have. So, I am now trying to do a Deathrun VIP plugin, as I wish using my own one. What it is suposed to do: /vip - gives a VIP 600 speed. /vipoff - sets the VIP's speed back to default. I got that figured easily. Too bad I can't seem to figure out how to get it to stay. I mean... remain 600 after changing the weapon. Also, the plugin should set VIPS skins. I don't yet know if that is going to happen, as I did not get to test the skins part.
So if you could please look in my code... So what I need is that speed stabillity. Plus, I'd really appreciate it if you could also check my code for setting those skins, ah I have no idea if I did it right. Oh, and one other question: what's the difference between setting the user's speed by pev_maxspeed or by set_user_maxspeed? Is one of them more appropriate? Thank you so much for your help! PS: Please go easy on me, I'm a rookie. :) Here's my code:
Spoiler
|
You need to hold the state of speed in a variable and regive the speed eighter (and this is recommended) with hamsandwich or (don't use this) with the CurWeapon-Event.
Have a look: PHP Code:
You need to hook the spawn event (using hamsandwich) and then set the model. Also you don't need to precache your files twice. Btw: - Using a switch statement is bether than multiple if statements (line 65-72) - You forgot the if-braces (line 47) - pev_maxspeed vs set_user_maxspeed: This is pretty much a question of preference and modules. If you already include Fakemeta you could aswell use the pev-things and skip the Fun-module. |
Re: Keeping speed
Thank you so much! I successfully (or I think I have) coded the skins part. But the spawn part... not so much. It returns few compilation errors ans warning. All of them on the same line, which is 24.
Please, could you further help me? This is what I got now.
Spoiler
|
Re: Keeping speed
Post the error / warning messages here. Do you use the 1.8.3 version of amxx? Because IIRC Ham_CS_Player_ResetMaxSpeed was only added there.
|
Re: Keeping speed
Quote:
A couple of minutes later: Good, I have downloaded the latest version of AMXX. My plugin is now compiled. I will edit my post the second I have it tested, just let me install the latest version on my server too. |
| All times are GMT -4. The time now is 21:14. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.