AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Plugin Modification #1 (https://forums.alliedmods.net/showthread.php?t=27123)

kmal2t 04-15-2006 02:26

Plugin Modification #1
 
BRAWR

organizedKaoS 04-15-2006 06:09

I dont know or play VS, but at least im trying to help. Try this
Code:
public client_PreThink(id)     {       if((is_user_alive(id)) && (get_team_int(id) == 1))         {         newButton[id] = get_user_button(id)         new oldButton = get_user_oldbutton(id)         new flags = get_entity_flags(id)                 //reset if we are on ground         if(caughtJump[id] && (flags & FL_ONGROUND))             {             numJumps[id] = 0             caughtJump[id] = false         }                 //begin when we jump         if((newButton[id] & IN_JUMP) && (flags & FL_ONGROUND) && !caughtJump[id] && !(oldButton & IN_JUMP) && !numJumps[id])             {             caughtJump[id] = true             entity_get_vector(id,EV_VEC_velocity,jumpVeloc[id])             jumpVeloc[id][2] = get_cvar_float("walljump_str")         }     } } public client_PostThink(id)     {     if(is_user_alive(id))         {         //do velocity if we walljumped         if(doJump[id])             {             entity_set_vector(id,EV_VEC_velocity,jumpVeloc[id])                         doJump[id] = false                         if(numJumps[id] >= get_cvar_num("walljump_num")) //reset if we ran out of jumps                 {                 numJumps[id] = 0                 caughtJump[id] = false             }         }     } } public Touch_World(id, world)     {     if(is_user_alive(id))         {         //if we touch wall and have jump pressed, setup for jump         if(caughtJump[id] && (newButton[id] & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND))             {                         //reverse velocity             for(new x=0;x<2;x++)                 jumpVeloc[id][x] *= -1.0                         numJumps[id]++             doJump[id] = true         }         } } stock get_team_int(id)     {     new TeamString[8]     get_user_team(id,TeamString,7)     if(equali(TeamString,"VAMPIRE"))         return 1     if(equali(TeamString,"SLAYER"))         return 2     return 0 }

kmal2t 04-16-2006 03:29

Thanks a million dude. I had figured it would be something along those lines but I didn't know how to exactly put it together. By that example I could probably implement team designation on my own in the future.


All times are GMT -4. The time now is 05:11.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.