Raised This Month: $ Target: $400
 0% 

[resolved] read_data, write_string(), etc.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
stupok
Veteran Member
Join Date: Feb 2006
Old 10-15-2006 , 15:05   [resolved] read_data, write_string(), etc.
Reply With Quote #1

I want to check if the player is on the team zombiemodel, and if so, switch the player to team humanmodel. TeamInfo is the event, in The Specialists, that gets called when a client switches teams.

I am trying to send the message TeamInfo to the client so that the client's team is switched back to the team humanmodel. The client_print message is sent, so I'm assuming I set everything up correctly, besides the sending of the message.

I know there are a bunch of threads on this, and I've looked at many of them, but I just couldn't find an answer for this. The documentation didn't help either.

Here's two versions attempting to achieve the same result:

This version does nothing as far as I can tell:
Code:
register_event("TeamInfo", "zombie_teams", "b") public zombies_teams(id) {     new arg1 = read_data(1)     new teamname[32]     read_data(2, teamname, 31)         //get_user_info(id, "model", teamname, 31)         if(!is_user_bot(id) && equali(teamname, zombiemodel))     {         message_begin(MSG_ONE, get_user_msgid("TeamInfo"), {0,0,0}, id)         write_byte(arg1)         write_string(humanmodel)         message_end()         client_print(id, print_chat, "You are a human!")     }     return PLUGIN_CONTINUE }

This version at least sends the print_chat message "You are a human!":
Code:
public client_infochanged(id) {     new teamname[32]         get_user_info(id, "model", teamname, 31)         if(!is_user_bot(id) && equali(teamname, zombiemodel))     {         message_begin(MSG_ONE, get_user_msgid("TeamInfo"), {0,0,0}, id)         write_byte(arg1)         write_string(humanmodel)         message_end()         client_print(id, print_chat, "You are a human!")     }     return PLUGIN_CONTINUE }

Last edited by stupok; 10-15-2006 at 17:26.
stupok is offline
 



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 04:53.


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