16.12.2015, 03:55
PHP код:
//==============================On Player Connect===============================
public OnPlayerConnect(playerid)
{
//-------//
// Remove OBJECT//
SetPlayerAttachedObject(playerid, 3, 19065, 2, 0.120000, 0.040000, -0.003500, 0, 100, 100, 1.4, 1.4, 1.4);
//time//
SetWorldTime(0);
// iTranslate_OnPlayerConnect(playerid);
//-----------------------------------LUsers-------------------------------------
PlayerInfo[playerid][bank] = 0;
PlayerInfo[playerid][bowner] = 0;
PlayerInfo[playerid][bowned] = 0;
PlayerInfo[playerid][Deaths] = 0;
PlayerInfo[playerid][Kills] = 0;
PlayerInfo[playerid][Jailed] = 0;
PlayerInfo[playerid][Frozen] = 0;
PlayerInfo[playerid][Level] = 0;
PlayerInfo[playerid][Vip] = 0;
PlayerInfo[playerid][RFCLevel] = 0;
PlayerInfo[playerid][AGLevel] = 0;
PlayerInfo[playerid][B2KLevel] = 0;
PlayerInfo[playerid][BALevel] = 0;
PlayerInfo[playerid][BMFLevel] = 0;
PlayerInfo[playerid][COPLevel] = 0;
PlayerInfo[playerid][BLevel] = 0;
PlayerInfo[playerid][GRPLevel] = 0;
PlayerInfo[playerid][KODLevel] = 0;
PlayerInfo[playerid][XEFLevel] = 0;
PlayerInfo[playerid][OSLevel] = 0;
PlayerInfo[playerid][TPKLevel] = 0;
PlayerInfo[playerid][LoggedIn] = 0;
PlayerInfo[playerid][Registered] = 0;
PlayerInfo[playerid][God] = 0;
PlayerInfo[playerid][TimesSpawned] = 0;
PlayerInfo[playerid][Muted] = 0;
PlayerInfo[playerid][MuteWarnings] = 0;
PlayerInfo[playerid][Warnings] = 0;
PlayerInfo[playerid][Caps] = 0;
PlayerInfo[playerid][DoorsLocked] = 0;
for(new i; i<PING_MAX_EXCEEDS; i++) PlayerInfo[playerid][pPing][i] = 0;
PlayerInfo[playerid][SpamCount] = 0;
PlayerInfo[playerid][SpamTime] = 0;
PlayerInfo[playerid][PingCount] = 0;
PlayerInfo[playerid][PingTime] = 0;
PlayerInfo[playerid][FailLogin] = 0;
PlayerInfo[playerid][ConnectTime] = gettime();
//-----------------------------------------------------
InShamal[playerid] = 0;
InAndrom[playerid]=0;
PlayerInfo[playerid][gang]=0;
gangInvite[playerid]=0;
format(tstring, sizeof(tstring), " ");
//-------------------------
TextDrawShowForPlayer(playerid, rules0);
TextDrawShowForPlayer(playerid, rules1);
TextDrawShowForPlayer(playerid, rules2);
new PlayerName[128],string[128], file[256];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
new tmp3[50]; GetPlayerIp(playerid,tmp3,50);
if(!strcmp(PlayerName,DEFAULT_OWNER)){
SendClientMessage(playerid, red, "This Name is Blacklisted!");
SendClientMessage(playerid, red, "If You Think,Its Mistake,Please Make Appeal Here , Http://wxtdm-rp.cf");
format(string,sizeof(string),"%s has been kicked by Server [reason: Blacklisted Name] ",PlayerName);
SendClientMessageToAll(grey,string);
SaveToFile("KickLog",string);
print(string);
}
if((!strcmp(tmp3,"74.115.0.***")) || (!strcmp(tmp3,"74.115.1.***")) || (!strcmp(tmp3,"74.115.2.***")) || (!strcmp(tmp3,"74.115.3.***")) || (!strcmp(tmp3,"74.115.4.***")) || (!strcmp(tmp3,"74.115.5.***")) || (!strcmp(tmp3,"74.115.6.***")) || (!strcmp(tmp3,"74.115.7.***"))) {
SendClientMessage(playerid, red, "Dont Use HotSpotShield or any other ip spoofing program!");
SendClientMessage(playerid, red, "If You Think,Its Mistake,Please Make Appeal Here , Http://wxtdm-rp.cf");
format(string,sizeof(string),"%s has been kicked by Server [reason: HotSpotShield] ",PlayerName);
SendClientMessageToAll(grey,string);
SaveToFile("KickLog",string);
print(string);
return Kick(playerid);
}
if(ServerInfo[ConnectMessages] == 1)
{
new mess[128],IP[128];
GetPlayerIp(playerid,IP,sizeof(IP));
format(mess,sizeof(mess),"%s Has Just Joined Our WXTDM~RP [3c]™[Welcome]. [ Country: %s | IP Address: %s | Ping: %i ]",PlayerName,GetPlayerCountryName(playerid),IP,GetPlayerPing(playerid));
printf(mess);
format(string, sizeof(string), "*** %s Has Just Joined Our WXTDM~RP [3c][Welcome] .(%s) ***", PlayerName, GetPlayerCountryName(playerid));
SendClientMessageToAll(COLOR_GREY, string);
}
//-----------------------------------------------------
if (dUserINT(PlayerName2(playerid)).("banned") == 1)
{
SendClientMessage(playerid, red, "This name is banned from this server!");
SendClientMessage(playerid, red, "If You Think,Its Mistake,Please Make Appeal Here , Http://wxtdm-rp.cf");
format(string,sizeof(string),"%s ID:%d was auto kicked. Reason: Name banned from server",PlayerName,playerid);
SendClientMessageToAll(grey, string); print(string);
SaveToFile("KickLog",string); Kick(playerid);
}
//-----------[ Name Kick ]-----------------
if(ServerInfo[NameKick] == 1) {
for(new s = 0; s < BadNameCount; s++) {
if(!strcmp(BadNames[s],PlayerName,true)) {
SendClientMessage(playerid,red, "Your name is on our black list, you have been kicked.");
SendClientMessage(playerid, red, "If You Think,Its Mistake,Please Make Appeal Here , Http://wxtdm-rp.cf");
format(string,sizeof(string),"%s ID:%d was auto kicked. (Reason: Forbidden name)",PlayerName,playerid);
SendClientMessageToAll(grey, string); print(string);
SaveToFile("KickLog",string); Kick(playerid);
return 1;
}
}
}
//-----------------------------------------------------
if(ServerInfo[PartNameKick] == 1) {
for(new s = 0; s < BadPartNameCount; s++) {
new pos;
while((pos = strfind(PlayerName,BadPartNames[s],true)) != -1) for(new i = pos, j = pos + strlen(BadPartNames[s]); i < j; i++)
{
SendClientMessage(playerid,red, "Your name is not allowed on this server, you have been kicked.");
SendClientMessage(playerid, red, "If You Think,Its Mistake,Please Make Appeal Here , Http://wxtdm-rp.cf");
format(string,sizeof(string),"%s ID:%d was auto kicked. (Reason: Forbidden name)",PlayerName,playerid);
SendClientMessageToAll(grey, string); print(string);
SaveToFile("KickLog",string); Kick(playerid);
return 1;
}
}
}
//-----------------------------------------------------
if(ServerInfo[Locked] == 1) {
PlayerInfo[playerid][AllowedIn] = false;
SendClientMessage(playerid,red,"Server is Locked! You have 20 seconds to enter the WXTDM~RP [3c] password before you are kicked!");
SendClientMessage(playerid,red," Type /password [password]");
LockKickTimer[playerid] = SetTimerEx("AutoKick", 20000, 0, "i", playerid);
}
//-----------------------------------------------------
if(strlen(dini_Get("ladmin/config/aka.txt", tmp3)) == 0) dini_Set("ladmin/config/aka.txt", tmp3, PlayerName);
else
{
if( strfind( dini_Get("ladmin/config/aka.txt", tmp3), PlayerName, true) == -1 )
{
new akastring[256];
format(akastring,sizeof(akastring),"%s,%s", dini_Get("ladmin/config/aka.txt",tmp3), PlayerName);
dini_Set("ladmin/config/aka.txt", tmp3, akastring);
}
}
//-----------------------------------------
format(string,128,"*** %s has joined the WXTDM~RP [3c].",PlayerName);
for(new i = 0; i < GetMaxPlayers(); i++) if(IsPlayerConnected(i) && playerid != i) SendClientMessage(i,grey,string);
//-----------------------------------------
if(!udb_Exists(PlayerName2(playerid))) {
PlayerInfo[playerid][Registered] = 0;
ShowPlayerDialog(playerid, DIALOGID0+1, DIALOG_STYLE_INPUT, "{FAF623}________»»»|- Register Account -|«««________","{0835C7}WXTDM~RP [3c]\n \n{00FF40}New Registration\nYour{146AC7}Name\n \n{FFFFFF}Do {FF0000}Not {FFFFFF}Register Multi Accounts\n{FAF623}Do {FF0000}Not {FAF623}Use The Same Password That You Use Elsewhere\n{00FF40}Please {D6D631}Enter A Password {00FF40}For Your Account:", "Register", "Quit"); // this is the dialog type
SendClientMessage(playerid, COLOR_BRIGHTRED, "++++========++++{66FFFF}++++========++++{FFFF00}++++========++++{0011FF}++++========++++{FF0000}++++========++++");
format(string, sizeof(string), "Welcome %s, To WXTDM~RP [3c] By [AG]EmanxD", PlayerName);
SendClientMessage(playerid, COLOR_ORANGE, string);
SendClientMessage(playerid, COLOR_BRIGHTRED, "++++========****{66FFFF}++++========****{FFFF00}++++========****{0011FF}++++========****{FF0000}++++========****");
SendClientMessage(playerid,COLOR_YELLOW, "{DBDB70}You have been given {0011FF}$9000000 starting money since you have no saved money as of yet!");
SendClientMessage(playerid,COLOR_YELLOW, "{66CDAA}You can register your current player name with {66FFFF}/register [password]'");
SendClientMessage(playerid,COLOR_YELLOW, "{0055FF}You must register and login to gain access to money, bank and vehicle saving options!");
SendClientMessage(playerid, COLOR_RED, "{49F505}|+++++++|> Open This {0011FF}/Server {66CDAA}Or {0011FF}/info <|+++++++|");
SendClientMessage(playerid, COLOR_BRIGHTRED, "{FA0C24}++**========++++{3DE3B1}**++========++**{FFFF00}**++========++**{FF00D9}**++========++**{FF00FF}**++========***");
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
GivePlayerMoney(playerid,9000000);
SetPlayerScore(playerid,5000);
}
if(udb_Exists(PlayerName2(playerid))) {
SendClientMessage(playerid, COLOR_BRIGHTRED, "{FA0C24}****========****{FFFFFF}****========****{FFFF00}****========****{0011FF}****========****{FF0000}****========****");
format(string, sizeof(string), "Welcome %s, to the new WXTDM~RP [3c] By [AG]EmanxD And [KOD]Vampire And [OS]John_Magdy", PlayerName);
SendClientMessage(playerid, COLOR_ORANGE, string);
SendClientMessage(playerid, COLOR_BRIGHTRED, "{FA0C24}****========****{FFFFFF}****========****{FFFF00}****========****{0011FF}****========****{FF0000}****========****");
format(file,256,"/ladmin/users/%s.sav",udb_encode(PlayerName));
new tmp[50],tmp2[256];
GetPlayerIp(playerid,tmp,128);
tmp2 = dini_Get(file,"ip");
if(!strcmp(tmp,tmp2,true) && ServerInfo[AutoLogin] == 1) {
format(string,128,"Welcome back, %s. You have automatically been logged in.",PlayerName);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
SendClientMessage(playerid, COLOR_BRIGHTRED, "++++========****{66FFFF}++++========****{FFFF00}++++========****{0011FF}++++========****{FF0000}++++========****");
GameTextForPlayer(playerid,"~w~Welcome~r~Back~w~!!!",20000,4);
PlayerInfo[playerid][LoggedIn] = 1;
GivePlayerMoney(playerid,dUserINT(PlayerName2(playerid)).("money")-GetPlayerMoney(playerid));
PlayerInfo[playerid][Deaths] = (dUserINT(PlayerName2(playerid)).("deaths"));
PlayerInfo[playerid][Kills] = (dUserINT(PlayerName2(playerid)).("kills"));
PlayerInfo[playerid][Level] = (dUserINT(PlayerName2(playerid)).("level"));
PlayerInfo[playerid][Vip] = (dUserINT(PlayerName2(playerid)).("vip"));
PlayerInfo[playerid][RFCLevel] = (dUserINT(PlayerName2(playerid)).("RFClevel"));
PlayerInfo[playerid][AGLevel] = (dUserINT(PlayerName2(playerid)).("AGlevel"));
PlayerInfo[playerid][B2KLevel] = (dUserINT(PlayerName2(playerid)).("B2Klevel"));
PlayerInfo[playerid][BALevel] = (dUserINT(PlayerName2(playerid)).("BAlevel"));
PlayerInfo[playerid][BMFLevel] = (dUserINT(PlayerName2(playerid)).("BMFlevel"));
PlayerInfo[playerid][COPLevel] = (dUserINT(PlayerName2(playerid)).("COPlevel"));
PlayerInfo[playerid][BLevel] = (dUserINT(PlayerName2(playerid)).("Blevel"));
PlayerInfo[playerid][GRPLevel] = (dUserINT(PlayerName2(playerid)).("GRPlevel"));
PlayerInfo[playerid][KODLevel] = (dUserINT(PlayerName2(playerid)).("KODlevel"));
PlayerInfo[playerid][XEFLevel] = (dUserINT(PlayerName2(playerid)).("XEFlevel"));
PlayerInfo[playerid][OSLevel] = (dUserINT(PlayerName2(playerid)).("OSlevel"));
PlayerInfo[playerid][TPKLevel] = (dUserINT(PlayerName2(playerid)).("TPKlevel"));
PlayerInfo[playerid][Registered] = 1;
LoadPlayer(playerid);
}
else {
format(string,sizeof(string),"The name %s, is already registered on this Server. Please login or you will be disconnected in 60 seconds",PlayerName);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
SendClientMessage(playerid, COLOR_BRIGHTRED, "++++========****{66FFFF}++++========****{FFFF00}++++========****{0011FF}++++========****{FF0000}++++========****");
PlayerInfo[playerid][LoggedIn] = 0;
ShowPlayerDialog(playerid, DIALOGID0+2, DIALOG_STYLE_INPUT, "{FF00D9}____________»»»|- Login Account -|«««____________","{0835C7}WXTDM~RP [3c] , (0.3c)\n \n{146AC7}Player Login\n \n{00FF40}The Name {00FF40}Registered.\n{FF002B}If This Is Not Your Account, Please Quit And Change Your Name.\n \nPlease {D6D631}Enter Your Password {FFFFFF}To Login:", "Login", "Quit");
SetTimerEx("KickTimer",60000000,0,"i",playerid);
}
}