// This is a comment // uncomment the line below if you want to write a filterscript //#define FILTERSCRIPT #include <a_samp> //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// #define VERDE 0x21DD00FF #define ROSSO 0xE60000FF //////////////////////////////////////////////////////////////////////////////// #define PING 1500 //////////////////////////////////////////////////////////////////////////////// public OnPlayerConnect(playerid) { if(GetPlayerPing(playerid) > PING) { new kick[1000]; format(kick,sizeof(kick),"[Info:] Sei stato kickato per ping molto alto! il massimo и di %d e tu hai fatto %d",PING,GetPlayerPing(playerid)); SendClientMessage(playerid,0xFFFFFFAA,kick); Kick(playerid); } new string[64], nomeb[MAX_PLAYER_NAME]; GetPlayerName(playerid,nomeb,MAX_PLAYER_NAME); format(string,sizeof string,"%s и entrato in London City DeathMatch!",nomeb); SendClientMessageToAll(VERDE,string); return 1; } public OnPlayerDisconnect(playerid, reason) { new string[64], nomeu[MAX_PLAYER_NAME]; GetPlayerName(playerid,nomeu,MAX_PLAYER_NAME); switch(reason) { case 0: format(string,sizeof string,"%s и uscito da London City DeathMatch!",nomeu); case 1: format(string,sizeof string,"%s и uscito da London City DeathMatch!",nomeu); case 2: format(string,sizeof string,"%s и uscito da London City DeathMatch! [kickato/bannato]",nomeu); } SendClientMessageToAll(ROSSO,string); return 1; } public OnPlayerSpawn(playerid) { new informazioni[1000]; new nome[MAX_PLAYER_NAME]; GetPlayerName(playerid, nome, sizeof (nome)); format(informazioni,sizeof(informazioni),"[Info:] Benvenuto %s! Hai: %d punti - %d$ - sei id %d",nome,GetPlayerScore(playerid),GetPlayerMoney(playerid),playerid); SendClientMessage(playerid,0xFFFFFFAA,informazioni); return 1; }
// This is a comment // uncomment the line below if you want to write a filterscript //#define FILTERSCRIPT #include <a_samp> //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// #define VERDE 0x21DD00FF #define ROSSO 0xE60000FF //////////////////////////////////////////////////////////////////////////////// #define PING 1500 //////////////////////////////////////////////////////////////////////////////// public OnPlayerConnect(playerid) { if(GetPlayerPing(playerid) > PING) { new kick[1000]; format(kick,sizeof(kick),"[Info:] You are kicked for high ping [%d] your ping is %d",PING,GetPlayerPing(playerid)); SendClientMessage(playerid,0xFFFFFFAA,kick); Kick(playerid); } new string[64], nomeb[MAX_PLAYER_NAME]; GetPlayerName(playerid,nomeb,MAX_PLAYER_NAME); format(string,sizeof string,"%s are logged in on London City Deathmatch!",nomeb); SendClientMessageToAll(VERDE,string); return 1; } public OnPlayerDisconnect(playerid, reason) { new string[64], nomeu[MAX_PLAYER_NAME]; GetPlayerName(playerid,nomeu,MAX_PLAYER_NAME); switch(reason) { case 0: format(string,sizeof string,"%s are slogged by London City Deathmatch!",nomeu); case 1: format(string,sizeof string,"%s are slogged by London City Deathmatch!",nomeu); case 2: format(string,sizeof string,"%s are slogged by London City Deathmatch! [kicked/banned]",nomeu); } SendClientMessageToAll(ROSSO,string); return 1; } public OnPlayerSpawn(playerid) { new informazioni[1000]; new nome[MAX_PLAYER_NAME]; GetPlayerName(playerid, nome, sizeof (nome)); format(informazioni,sizeof(informazioni),"[Info:] Welcome %s! You Have: %d points - %d$ - your level is %d",nome,GetPlayerScore(playerid),GetPlayerMoney(playerid),playerid); SendClientMessage(playerid,0xFFFFFFAA,informazioni); return 1; }
Not bad as this is your first, but such small codes can be posted in Useful snippets. And btw, you don't need to set the string's size to 1000 for this. It's just using alot of usage. A client message, just sends 128 length of characters, so the size being 128 is better. And also, for ping testing, use a timer which repeats and counts the way of going.
And, why do you put any other server's name as welcome? ;o |
because I'm creating a gamemode called London City DM, sorry for the mistake!
the next version will be better. |