30.01.2013, 12:12
Hello guys came samp forum filterscripts bring a simple but very useful for server truck.
Everyone knows the message when the player logged in you can create
your gamemode, so starting this idea I did this FS, it works this
geito, When you be "records" in their mensage remained N / A, you can exchange
Of course, there when you switch to connect vai appears mensage you put it,
This message may contain color. I'll give an example.
He had been in time to appear pink.
I also did two cmd's for adm if a ingraзadinho cencuradas use words,
divugue or ip's mensage this, he can edit the player online and also offline!
Code :
Credits:
Simple but useful
Everyone knows the message when the player logged in you can create
your gamemode, so starting this idea I did this FS, it works this
geito, When you be "records" in their mensage remained N / A, you can exchange
Of course, there when you switch to connect vai appears mensage you put it,
This message may contain color. I'll give an example.
Код:
/tfrase {D900D3} Rosa
I also did two cmd's for adm if a ingraзadinho cencuradas use words,
divugue or ip's mensage this, he can edit the player online and also offline!
Code :
pawn Код:
#include a_samp
#include DOF2
#include zcmd
#include sscanf2
#define MAX_TITO 50
#define NFST "CFrases/%s.ini"
#define CallBack::%0(%1) forward %0(%1); \
public %0(%1)
new PlayerName [ MAX_TITO ] [ 50 ];
public OnFilterScriptInit ( )
{
print("|--- FS ---|\n" "Fs done by Mauricio Moraes By mau.tito");
return 1;
}
public OnFilterScriptExit ( )
{
return 1;
}
public OnPlayerConnect ( playerid )
{
new file [ 50 ],
tito [ 100 ];
CkeckNick ( playerid ) ;
format ( file , sizeof ( file ) , NFST , PlayerName[ playerid ] ) ;
if( !DOF2_FileExists ( file ) )
{
DOF2_CreateFile ( file );
DOF2_SetString ( file , "Frase", "N/A" ) ;
DOF2_SaveFile();
}
format ( tito , sizeof ( tito ) , "Conect: %s entered the server: %s", PlayerName[ playerid ] , DOF2_GetString ( file , "Frase" ) ) ;
SendClientMessageToAll ( -1 , tito);
return 1;
}
command(tfrase, playerid , params [] )
{
new str [ 80 ] ,
TFrase [ 80 ] ,
file [ 50 ];
if ( sscanf ( params , "s", TFrase ) )
return SendClientMessage ( playerid , -1 , "[CMD] /tfrase [ NOVA FRASE ] " ) ;
format ( file , sizeof ( file ) , NFST , PlayerName[ playerid ] ) ;
DOF2_SetString ( file , "Frase", TFrase ) ;
format ( str ,sizeof ( str ) , "TFS: You swapped frase to %s" , TFrase ) ;
SendClientMessage ( playerid , -1 , str ) ;
DOF2_SaveFile();
return 1;
}
command(editarfrase, playerid, params [] )
{
new file [ 50 ] ,
ID ,
TFrase [ 75 ] ,
str [ 95 ] ;
if( !IsPlayerAdmin ( playerid ) )
return SendClientMessage ( playerid , -1 , "[ERROR] You do not and admin rcon" ) ;
if ( sscanf ( params , "is", ID , TFrase ) )
return SendClientMessage ( playerid , -1 , "[CMD] /editarfrase [ ID ] [ FRASE NOVA ] " ) ;
format ( file , sizeof ( file ) , NFST , PlayerName[ ID ] ) ;
if( !IsPlayerConnected ( ID ) )
return SendClientMessage ( playerid , -1 , "[BUG] This player is not online" ) ;
DOF2_SetString ( file , "Frase", TFrase) ;
format ( str , sizeof ( str ) , "(TFS) Admin %s changed the phrase id %i to: %s", PlayerName[ playerid ] , ID , TFrase ) ;
SendClientMessage ( playerid , -1 , str ) ;
DOF2_SaveFile();
return 1;
}
command(editarfraseoff, playerid, params [] )
{
new file [ 50 ] ,
Conta [ 50 ] ,
TFrase [ 75 ] ,
str [ 95 ] ;
if( !IsPlayerAdmin ( playerid ) )
return SendClientMessage ( playerid , -1 , "[ERROR] You do not and admin rcon" ) ;
if ( sscanf ( params , "ss", Conta , TFrase ) )
return SendClientMessage ( playerid , -1 , "[CMD] / editarfraseoff [ACCOUNT] [NEW PHRASE]" ) ;
format ( file , sizeof ( file ) , NFST , Conta ) ;
if( !DOF2_FileExists ( file ) )
return SendClientMessage ( playerid , -1 , "This account does not exist" ) ;
DOF2_SetString ( file , "Frase", TFrase) ;
format ( str , sizeof ( str ) , "(TFS) Admin %s has changed the phrase from %s to %s", PlayerName[ playerid ] , Conta , TFrase ) ;
SendClientMessage ( playerid , -1 , str ) ;
DOF2_SaveFile();
return 1;
}
CallBack::CkeckNick ( playerid )
{
new mauricio [ MAX_PLAYER_NAME ] ;
GetPlayerName ( playerid , mauricio , sizeof ( mauricio ) ) ;
PlayerName[ playerid ] = mauricio ;
return 1;
}
PHP код:
Mauricio Moraes By mau.tito