Raised This Month: $ Target: $400
 0% 

Teleport stuck help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rains
Member
Join Date: Dec 2005
Location: Sweden
Old 12-20-2005 , 15:07   Teleport stuck help
Reply With Quote #1

Hello, I'm making a mod for CS, and I want to include a teleport.
The problem is, I have no idea how to check if a player is stuck, the current code is:
Code:
public blink(id)     {     if (classes[id] == 3 && skills[id][2] == 0 && mana[id]>=BLINK_COST)         {         new blinkorg[3]         new blinkorg2[3]         get_user_origin(id,blinkorg,0)         get_user_origin(id,blinkorg2,3)         if (blinkorg2[0]>=blinkorg[0])             {             blinkorg2[0] = blinkorg2[0] - 30         }         else         {             blinkorg2[0] = blinkorg2[0] + 30         }         if (blinkorg2[1]>=blinkorg[1])             {             blinkorg2[1] = blinkorg2[1] - 30         }         else         {             blinkorg2[1] = blinkorg2[1] + 30         }         blinkorg2[2] = blinkorg2[2] + 30         set_user_origin(id,blinkorg2)         mana[id] = mana[id]-BLINK_COST     }     return PLUGIN_HANDLED }

I would really appreciate help
__________________
"My mouth is dry... My face is numb..." ~ Brain Stew - Green Day
Rains is offline
Send a message via MSN to Rains
WaZZeR++
Veteran Member
Join Date: Mar 2005
Location: Sweden
Old 12-20-2005 , 16:32  
Reply With Quote #2

maybe you can check with:
Code:
get_entity_flags(id) &FL_ONGROUND

dont know what this will return when your stuck, but it will return 0 when you are in the air. like:

Code:
while(get_entity_flags(id) &FL_ONGROUND)     origine[2]+=5

or something for the z axel
WaZZeR++ is offline
Send a message via MSN to WaZZeR++
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-20-2005 , 17:30  
Reply With Quote #3

Try this:

Code:
if( get_entity_flags(id) & FL_PARTIALGROUND )     // you are stuck
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Rains
Member
Join Date: Dec 2005
Location: Sweden
Old 12-21-2005 , 10:45  
Reply With Quote #4

Thanks, I'll try them.

EDIT:
It didn't work. Code:
Code:
 public blink(id)     {     if (classes[id] == 3 && skills[id][2] == 0 && mana[id]>=BLINK_COST)         {         new blinkorg[3]         new blinkorg2[3]         get_user_origin(id,blinkorg,0)         get_user_origin(id,blinkorg2,3)         if (blinkorg2[0]>=blinkorg[0])             {             blinkorg2[0] = blinkorg2[0] - 30         }         else         {             blinkorg2[0] = blinkorg2[0] + 30         }         if (blinkorg2[1]>=blinkorg[1])             {             blinkorg2[1] = blinkorg2[1] - 30         }         else         {             blinkorg2[1] = blinkorg2[1] + 30         }         blinkorg2[2] = blinkorg2[2] + 30         set_user_origin(id,blinkorg2)         if(get_entity_flags(id) &FL_PARTIALGROUND)         {             mana[id] = mana[id] - BLINK_COST         }         else         {             set_user_origin(id, blinkorg)         }     }     return PLUGIN_HANDLED }
__________________
"My mouth is dry... My face is numb..." ~ Brain Stew - Green Day
Rains is offline
Send a message via MSN to Rains
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-21-2005 , 19:55  
Reply With Quote #5

What didn't work?
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 12-22-2005 , 05:40  
Reply With Quote #6

look at the amx_blink plugin (teleport by sight or something)
__________________
Sig(h)!
Obbin is offline
Rains
Member
Join Date: Dec 2005
Location: Sweden
Old 12-22-2005 , 11:21  
Reply With Quote #7

Heh, I found out an other way, thanks anyway

(the stuff that didn't work was: )
Code:
        if(get_entity_flags(id) &FL_PARTIALGROUND)         {             mana[id] = mana[id] - BLINK_COST         }         else         {             set_user_origin(id, blinkorg)         }
__________________
"My mouth is dry... My face is numb..." ~ Brain Stew - Green Day
Rains is offline
Send a message via MSN to Rains
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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