Raised This Month: $ Target: $400
 0% 

user_origin help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Smokey485
Senior Member
Join Date: Dec 2004
Location: Newt 'Ellin
Old 01-16-2005 , 22:23   user_origin help
Reply With Quote #1

How do I check every players health, and when one of there health is at 6hp, then it teleports them to


origin, x:1560 y:1372 z-403 stored

help me out her,e I havent coded in 3 - 4 months, I can understand the coding but I cant really write it without getting errors, thx.
Smokey485 is offline
Send a message via AIM to Smokey485 Send a message via MSN to Smokey485
Ramirez
Member
Join Date: Aug 2004
Old 01-16-2005 , 23:05  
Reply With Quote #2

Use get_user_health
then if their health is below a certain value use set_user_origin..
Ramirez is offline
Smokey485
Senior Member
Join Date: Dec 2004
Location: Newt 'Ellin
Old 01-16-2005 , 23:12  
Reply With Quote #3

I already knew those two

I wanna know how to check there freakin health
...
I tried
Code:
if(get_user_health(id) == 30) { client_print(id, print_chat, "Your starting to get hungry") }
but that didnt work. I can use origin fine(i think).

Maybe im not checking all players? Do i have to put 30 in quotes?
Smokey485 is offline
Send a message via AIM to Smokey485 Send a message via MSN to Smokey485
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-17-2005 , 00:01  
Reply With Quote #4

What mod is this for?
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Smokey485
Senior Member
Join Date: Dec 2004
Location: Newt 'Ellin
Old 01-17-2005 , 00:24  
Reply With Quote #5

The Specialists...

well, heres my coding(horrible)

Code:
new eatburgerregister[3] = { 1533, 1372, -403 }; // Yes? new eat711register[3] = { -2303, 1221, -411 }; // Yes? new eatdinerregister[3] = { -144, -451, -359 }; // Yes? new eatdistburger = 130; // Yes new eatdist711 = 70; // Yes new eatdistdiner = 160; // Yes public eatstatus(id) {     new hp = get_user_health(id)     new players[32], count     get_players(players, count)     new origin[3];     get_user_origin(id, origin) //  new origin1[3] = id //  new origins = get_user_origin(id, origin) // if too far from eat point /*   if(get_distance(origin,eatburgerregister) > eatdistburger) {     client_print(id,print_chat,"* [EAT] You arent at a eat point, go to a 711, Diner, or In & Out");    }    if(get_distance(origin,eat711register) > eatdist711) {     client_print(id,print_chat,"* [EAT] You arent at a eat point, go to a 711, Diner, or In & Out");    } */ if(get_distance(origin,eatdinerregister) > eatdistdiner) {    client_print(id,print_chat,"* [EAT] You arent at a eat point, go to a 711, Diner, or In & Out");    return PLUGIN_HANDLED    }    if(get_distance(origin,eatburgerregister) <= eatdistburger) {    set_user_health(id, hp +21)    }    if(get_distance(origin, eat711register) <= eatdist711) {    set_user_health(id, hp +15)    }    if(get_distance(origin, eatdinerregister) <= eatdistdiner) {    set_user_health(id, hp +35)    } }
Smokey485 is offline
Send a message via AIM to Smokey485 Send a message via MSN to Smokey485
BlueRaja
Senior Member
Join Date: Nov 2004
Old 01-17-2005 , 03:01  
Reply With Quote #6

Quote:
Originally Posted by Smokey485
I tried
Code:
if(get_user_health(id) == 30) { client_print(id, print_chat, "Your starting to get hungry") }
but that didnt work. I can use origin fine(i think).

Maybe im not checking all players? Do i have to put 30 in quotes?
That only works if their health is exactly 30 - have you tried doing something like <insert code that follows>?
Code:
new iHealth = get_user_health(id) if(iHealth>=15 && iHealth<=30)   //Do something here

btw, your != you're.
BlueRaja is offline
Send a message via AIM to BlueRaja Send a message via MSN to BlueRaja
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 01-17-2005 , 03:09  
Reply With Quote #7

Code:
new eatburgerregister[3] = { 1533, 1372, -403 }; // Yes? new players[32], inum; get_players(players,inum); for(new x = 0; x < inum; x++) {      if(get_user_health(x) =< 30 )      {           set_user_origin(x, eatburgerregister);      } }
Freecode is offline
BlueRaja
Senior Member
Join Date: Nov 2004
Old 01-17-2005 , 03:09  
Reply With Quote #8

[edit]Freecode beat me to it.
BlueRaja is offline
Send a message via AIM to BlueRaja Send a message via MSN to BlueRaja
Smokey485
Senior Member
Join Date: Dec 2004
Location: Newt 'Ellin
Old 01-17-2005 , 10:12  
Reply With Quote #9

wow u guys are really helping me here

thanks.
But I wanted it at exactly a certain health then teleport em..

cause if someone gets shot by a gun & they get under 10 health or whatever, they'll be teleported then the person who was supposed to kill him wont be able to. This could be good for a hospital thing

Question: if x = 0 then how is x the id dude? Confusing, maybe 0 is all players so itll teleport them all, lol. agh.
Smokey485 is offline
Send a message via AIM to Smokey485 Send a message via MSN to Smokey485
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-17-2005 , 13:18  
Reply With Quote #10

Good point on the x thing, Freecode's may not work, he forgot to access the players array. Use this instead:

Code:
new eatburgerregister[3] = { 1533, 1372, -403 }; // Yes? new players[32], inum; get_players(players,inum); for(new x = 0; x < inum; x++) {      if(get_user_health(players[x]) =< 30 )      {           set_user_origin(players[x], eatburgerregister);      } }

Also, funny to see that people are still using my code.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
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 19:29.


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