Raised This Month: $ Target: $400
 0% 

Subplugin Submission [ZP] Sub-Plugin: Rewards 1.4 | Updated [FIXED KNIFE BUG]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 04-21-2010 , 13:17   Re: [ZP] Sub-Plugin: Rewards 1.0
Reply With Quote #5

Instead of using this stock for color printing..
PHP Code:
// Colored chat print. Thanks to MeRcyLeZZ
zp_colored_print(target, const message[], any:...)
{
 static 
buffer[512], iargscount
 argscount 
numargs()
 
 
// Send to everyone
 
if (!target)
 {
  static 
player
  
for (player 1player <= g_maxplayersplayer++)
  {
   
// Not connected
   
if (!is_user_connected(player))
    continue;
   
   
// Remember changed arguments
   
static changed[5], changedcount // [5] = max LANG_PLAYER occurencies
   
changedcount 0
   
   
// Replace LANG_PLAYER with player id
   
for (2argscounti++)
   {
    if (
getarg(i) == LANG_PLAYER)
    {
     
setarg(i0player)
     
changed[changedcount] = i
     changedcount
++
    }
   }
   
   
// Format message for player
   
vformat(buffercharsmax(buffer), message3)
   
   
// Send it
   
message_begin(MSG_ONE_UNRELIABLEg_msgSayText_player)
   
write_byte(player)
   
write_string(buffer)
   
message_end()
   
   
// Replace back player id's with LANG_PLAYER
   
for (0changedcounti++)
    
setarg(changed[i], 0LANG_PLAYER)
  }
 }
 
// Send to specific target
 
else
 {
  
// Format message for player
  
vformat(buffercharsmax(buffer), message3)
  
  
// Send it
  
message_begin(MSG_ONEg_msgSayText_target)
  
write_byte(target)
  
write_string(buffer)
  
message_end()
 }

U can actually use this stock:
PHP Code:
// Prints chat in colours
stock zp_colored_print(const id, const input[], any:...)
{
 new 
iCount 1iPlayers[32]
 
 static 
szMsg[191]
 
vformat(szMsgcharsmax(szMsg), input3)
 
 
replace_all(szMsg190"|g|""^4"// green txt
 
replace_all(szMsg190"|y|""^1"// orange txt
 
replace_all(szMsg190"|ctr|""^3"// team txt
 
replace_all(szMsg190"|w|""^0"// team txt
 
 
if(idiPlayers[0] = id
 
else get_players(iPlayersiCount"ch")
  
 for (new 
0iCounti++)
 {
  if (
is_user_connected(iPlayers[i]))
  {
   
message_begin(MSG_ONE_UNRELIABLEg_msgSayText_iPlayers[i])
   
write_byte(iPlayers[i])
   
write_string(szMsg)
   
message_end()
  }
 }

__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
 



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 15:22.


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