Raised This Month: $ Target: $400
 0% 

Why this doesnt work?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kz1.0
Senior Member
Join Date: Jan 2013
Location: Vietnam
Old 01-30-2013 , 10:44   Why this doesnt work?
Reply With Quote #1

I have this code, the print is ok but the set_pev doesn't work .
PHP Code:
public event_new_round() 
{
hour 7
set_task
(20.0"hour_plus"_,_,_"a"15)
set_task(20.0"checkFree"_,_,_"a"15)
_UpdateHud()
}

public 
checkFree(id)
switch (
hour)
{
case 
121318192021:
{
client_print(idprint_chat"TEST 1"//print chat ok but the model doesn't change
set_pev(idpev_body2)
//entity_set_int(id, EV_INT_skin, 3)
}

default:
{
client_print(idprint_chat"TEST 2")
set_pev(idpev_body3)
//set_pev(id, pev_skin, 0)
}


Last edited by YamiKaitou; 01-30-2013 at 19:24.
Kz1.0 is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 01-30-2013 , 11:08   Re: Why this doesnt work?
Reply With Quote #2

public checkFree(id)

This ID is zero.
__________________
Retired.
Xalus is offline
Kz1.0
Senior Member
Join Date: Jan 2013
Location: Vietnam
Old 01-30-2013 , 11:09   Re: Why this doesnt work?
Reply With Quote #3

but why the cleint_print still works, and if so, what i have to do
Kz1.0 is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 01-30-2013 , 11:12   Re: Why this doesnt work?
Reply With Quote #4

because if client_print's first argument is zero (which it is in this case), it shows the message to all players.

If you want to change the pev for each player like that, you need to loop through all players in the task.
Backstabnoob is offline
Kz1.0
Senior Member
Join Date: Jan 2013
Location: Vietnam
Old 01-30-2013 , 11:29   Re: Why this doesnt work?
Reply With Quote #5

Like this ??
PHP Code:
new players[32
new 
max_players
get_players
(playersmax_players"a");

for (new 
imax_playersi++)
{
        
set_pev(players[i], pev_body1)
        
//....


Last edited by Kz1.0; 01-30-2013 at 11:30.
Kz1.0 is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 01-30-2013 , 11:33   Re: Why this doesnt work?
Reply With Quote #6

yes
Backstabnoob is offline
Kz1.0
Senior Member
Join Date: Jan 2013
Location: Vietnam
Old 01-30-2013 , 12:04   Re: Why this doesnt work?
Reply With Quote #7

Works fine, thanks you guys for quick and helpful replies
Kz1.0 is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 01-30-2013 , 12:26   Re: Why this doesnt work?
Reply With Quote #8

Don't delete your post.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 01-30-2013 , 12:30   Re: Why this doesnt work?
Reply With Quote #9

Quote:
Originally Posted by wickedd View Post
Don't delete your post.
Now we know, we never gotta help him again in the future ;)
__________________
Retired.
Xalus is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 01-30-2013 , 19:24   Re: Why this doesnt work?
Reply With Quote #10

Post restored, do not blank your posts
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Reply


Thread Tools
Display Modes

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 20:37.


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