Raised This Month: $ Target: $400
 0% 

Natives


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Intouchable
Senior Member
Join Date: Mar 2012
Old 05-15-2012 , 14:29   Natives
Reply With Quote #1

Rigister like this:
PHP Code:
public plugin_natives()
{
 
register_native("log_kick""native_log_kick"1)
}

public 
native_log_kick(const szLog[], any:...)
{
 new 
szFile[100], iFileHandleszData[20], szMapName[30], szBase[40], szLogEx[150]
 
get_mapname(szMapNamecharsmax(szMapName))
 
get_time("%Y%m%d"szDatacharsmax(szData))
 
get_basedir(szBasecharsmax(szBase))

 
vformat(szLogExcharsmax(szLogEx), szLog2
 
 
format(szFilecharsmax(szFile), "%s/logs/%s"szBaseKICK_LOGS_DIR)
 if(!
dir_exists(szFile)) mkdir(szFile)
 
format(szFilecharsmax(szFile), "%s/Kicks%s.log"szFileszData)
 
 if(
file_exists(szFile))
  
iFileHandle fopen(szFile"at")
 else
  
iFileHandle fopen(szFile"wt")
  
 if(
iFileHandle)
 {
  
get_time("%Y/%m/%d %H:%M:%S"szDatacharsmax(szData))
  
format(szLogExcharsmax(szLogEx), "^n%s: %s"szDataszLogEx)
  
fputs(iFileHandleszLogEx)
 }
 
fclose(iFileHandle)

Using:
PHP Code:
native log_kick(const szLog[], any:..)

log_kick("[KICK] Admininstartor %s <%s> (%s) kick player %s <%s> (%s) už %s!"clANameclAIPclASteamidclPNameclPIPclPSteamidszReason
And to szLog writing emty fields.. Why with the native don't get normal string?
Intouchable 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 00:22.


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