View Single Post
Destro-
Veteran Member
Join Date: Jun 2010
Location: $me->location();
Old 09-19-2010 , 14:11   Re: [ES] El Offtopic va ACA! (con reglas)
#6584

Que puedo optimizar de esto:
PHP Code:
stock new_chat_color(const id, const team_color[], const input[], any:...)
{
 new 
teamInfo get_user_msgid ("TeamInfo")
 new 
ncc_maxplayers get_maxplayers()
 new 
bool:send[33]
 static 
msg[191]
 
vformat(msg190input3)
 
 
replace_all(msg190"!g""^x04"// Green Color
 
replace_all(msg190"!y""^x01"// Default Color
 
replace_all(msg190"!t""^x03"// Team Color
 
if(!id){
 for (new 
1ncc_maxplayersi++){
  if (
is_user_connected(i)){
   new 
team_player[10]
   
get_user_team (iteam_player9)
   
send[i] = true
   message_begin
(MSG_ONEteamInfo_i)
   
write_byte(i)
   
write_string(team_color)
   
message_end()
   if(
send[i]){
    
message_begin(MSG_ONEget_user_msgid("SayText"), {000}, i)
    
write_byte(i)
    
write_string(msg)
    
message_end()
   }
   
send[i] = false
   message_begin
(MSG_ONEteamInfo_i)
   
write_byte(i)
   
write_string(team_player)
   
message_end()
  }
 }
 }
 if(
id){
 if (
is_user_connected(id)){
   new 
team_player[10]
   
get_user_team (idteam_player9)
   
send[id] = true
   message_begin
(MSG_ONEteamInfo_id)
   
write_byte(id)
   
write_string(team_color)
   
message_end()
   if(
send[id]){
    
message_begin(MSG_ONEget_user_msgid("SayText"), {000}, id)
    
write_byte(id)
    
write_string(msg)
    
message_end()
   }
   
send[id] = false
   message_begin
(MSG_ONEteamInfo_id)
   
write_byte(id)
   
write_string(team_player)
   
message_end()
 }
 }

@EDIT
Funsiona de 10 xD,una duda q tengo,es imposible meter 2 colores de team en un mensaje?por lo q vi si
pd:wiii!!!mi primer stock util xD
__________________

Last edited by Destro-; 09-19-2010 at 16:22.
Destro- is offline