Код:
// OnPlayerConnect
public OnPlayerConnect(playerid)
{
PlayerTimer[playerid] = -2;
TextDrawHideForPlayer(playerid, PlayerExpDraw[playerid]);
PlayerLicznik[playerid]=0;
Freezed[giveplayerid]=false;
driftoff[playerid]=0;
HeliKill[playerid]=0;
TextDrawSetString(MafiaDraw[playerid], " ");
IsPlayerZW[playerid] = 0;
TextDrawHideForPlayer(playerid, PlayerTextDraw[playerid]);
new playername[MAX_PLAYER_NAME];
new tmp[256];
new idx;
GetPlayerName(playerid, playername, sizeof(playername));
tmp = dini_Get(FILE_BLACKLIST, playername);
if (strval(strtok(tmp, idx, ',')) == 1){
new strx[256];
format(strx, 256, "PLayer: %s has been kicked by SERVER(Anty-Shit) Reason: %s", PlayerName(playerid), strtok(tmp, idx, ','));
SendClientMessageToAll(CADMIN,strx);
SendClientMessage(playerid, CADMIN, " ");
SendClientMessage(playerid, CADMIN, " ");
SendClientMessage(playerid, CADMIN, " ");
format(strx, 256, "You have been kicked by SERVER(Anty-Shit) Reason: %s", strtok(tmp, idx, ','));
SendClientMessage(playerid,CADMIN,strx);
SendClientMessage(playerid, CADMIN, " ");
SendClientMessage(playerid, CINFO, " If in doubt, contac the server owner");
SendClientMessage(playerid, CADMIN, " ");
SendClientMessage(playerid, CADMIN, " ");
tmp = dini_Get(FILE_TOTALSTAT, "kicks");
dini_IntSet(FILE_TOTALSTAT, "kicks", strval(tmp)+1);
AddPlayersKicks(PlayerName(playerid));
ToLog("CzarnaLista", "Player: %s has been kicked by SERVER, Reason: %s", PlayerName(playerid), strtok(tmp, idx, ','));
Kick(playerid);
return 1;
}
idx = 0;
if (strval(strtok(tmp, idx, ',')) == 2){
new strx[256];
format(strx, 256, "Player: %s has been banned by SERVER(Anty-Shit) Reason: %s", PlayerName(playerid), strtok(tmp, idx, ','));
SendClientMessageToAll(CADMIN,strx);
SendClientMessage(playerid, CADMIN, " ");
SendClientMessage(playerid, CADMIN, " ");
SendClientMessage(playerid, CADMIN, " ");
format(strx, 256, "You are banned by SERVER(Anty-Shit) Reason: %s", strtok(tmp, idx, ','));
SendClientMessage(playerid,CADMIN,strx);
SendClientMessage(playerid, CADMIN, " ");
SendClientMessage(playerid, CINFO, " If in doubt, contac the server owner");
SendClientMessage(playerid, CADMIN, " ");
SendClientMessage(playerid, CADMIN, " ");
new tmp2[256];
tmp2 = dini_Get(FILE_TOTALSTAT, "bans");
dini_IntSet(FILE_TOTALSTAT, "bans", strval(tmp2)+1);
ToLog("CzarnaLista", "Player %s has been banned by SERVER, Reason: %s", PlayerName(playerid), strtok(tmp, idx, ','));
AddBannedPlayer(playerid, "Nick na czarnej liњcie");
return 1;
}
DriftPointsNow[playerid] = 0;
WarnSystem[playerid] = 0;
ResetPlayerMoney(playerid);
AlcatrazWarning[playerid] = 0;
ApplyAnimation(playerid,"DANCING","DAN_LOOP_A",4.1,1,1,1,1,1);
AllowPlayerTeleport(playerid, 0);
GiveCashed[playerid] = 0;
PlayerTempObj[playerid]=CreatePlayerObject(playerid, 9254, 2006.60, 854.51, 2507.73, 0.00, 0.00, 90.00);
LastText[playerid] = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
ToLog("joins", "%s(IP:%s) wszedі na Server.", PlayerName(playerid), ReturnIP(playerid));
new tmp22[256];
tmp22 = dini_Get(FILE_TOTALSTAT, "joins");
dini_IntSet(FILE_TOTALSTAT, "joins", strval(tmp22)+1);
GetPlayerName(playerid, gPlayerName[playerid], MAX_PLAYER_NAME);
Pinger[playerid] = 0;
PlayerDMing[playerid] = 0;
SpamCount[playerid] = 0;
Stunt[playerid] = 0;
WannaDrift[playerid]=0;
PlayerEnterVehicle[playerid] = -1;
AllowPlayerTeleport(playerid, 0);
if(PropMuteAll==1)
playermuted[playerid] = true; else playermuted[playerid] = false;
gps[playerid] = -1;
XDState[playerid] = 0;
TogglePlayerClock(playerid, false);
GameTextForPlayer(playerid, "~b~Welcome_To_Estonian_~g~~r~Fun_~g~STRD_~r~~r~Server_/rules_Do_Not_Kill_Just_For_Fun!",9000,3);
ShowAdminTexts[playerid] = true;
IncorrectIP[playerid]=false;
PlayerIP[playerid]=ReturnIP(playerid);
FastEnter[playerid]=false;
new str[256];
Count[playerid]=0;
set(PlayerConnectName[playerid],PlayerName(playerid));
new id = random(400);
PlIdCo[playerid]=id;
new idcnt;
for(new x=0;x<200;x++)if(IsPlayerConnected(x) && PlIdCo[x]==id)idcnt++;
while(idcnt != 0){
id = random(400);
idcnt = 0;
for(new x=0;x<200;x++)if(IsPlayerConnected(x) && PlIdCo[x]==id)idcnt++;
}
PlIdCo[playerid]=id;
ConnectCoId[playerid] = id;
#define PlColor[%1] ColorsAlpha77[PlIdCo[%1]]
Active[playerid]=1;
once[playerid] = 0;
once2[playerid] = 0;
muzzza[playerid] = 0;
//TextDrawShowForPlayer(playerid, NullText);
//TextDrawShowForPlayer(playerid, BoxDraw);
TextDrawShowForPlayer(playerid, ActualTime);
TextDrawShowForPlayer(playerid, PlayerPingDraw[playerid]);
CarKill[playerid] =0 ;
RampOff[playerid] = 0;
HeliKill[playerid] = 0;
DriveBy[playerid] = 0;
MeFirstTime[playerid] =0;
HydraKill[playerid] =0 ;
JailStatus[playerid]=0;
SpawnKill[playerid] = 0;
IsPlayerKilling[playerid] = 0;
HideAdmins[playerid] = 0;
BlokadaKomend[playerid] = 0;
ignorePM[playerid] = 0;
SendClientMessage2(playerid,0x4A73B5FF,"---------------------Welcome to Estonian STRD Server By Admin Joe---------------------");
SendClientMessage2(playerid,0xFAF305FF,"***Server-Message: Servers Are 2 Logging System!");
SendClientMessage2(playerid,0xFF8000FF,"1 -First: /register To Register! And /login To Login!");
SendClientMessage2(playerid,0xFF8000FF,"2 -Second: /registername To Register! /loginname To Login!");
SendClientMessage2(playerid,0xFF0000FF,"|/x-cmd - All Commands! |/x-reg - All Rules! |/x-help - All Helps Commands!");
SendClientMessage2(playerid,0xFF0000FF,"/x-tips - Tips And Tutorials Ps: !!!All Commands Started /x- ");
SendClientMessage2(playerid,0x808080FF,"Other Cmd, Rules, Tips, Etc Find Server Home Page! Type /x-site Hawe Fun Now!");
gActivePlayers[playerid]++;
gLastGaveCash[playerid] = GetTickCount();
playerCheckpoint[playerid]=999;
LoggedIn[playerid]=0;
playerGang[playerid]=0;
gangInvite[playerid]=0;
SetPlayerExp(playerid, 0);
PlayerPlaySound(playerid,1187,-1917.2386,240.1739,44.0471);
killtimer[playerid] = 0;
new string2[256];
new onlinecount;
string2 = dini_Get(DF_CFG_FILE, "OnlineRecord");
onlinecount = strval(string2);
if(GTP() > onlinecount){
new oldonline;
oldonline = GTP();
format(string2, sizeof(string2), "New player record : %d !", oldonline);
SendClientMessageToAll2(CINFO, string2);
format(string2, sizeof(string2), "%d", oldonline);
dini_Set(DF_CFG_FILE, "OnlineRecord", string2);
}
isPlayerAdminEx[playerid]=false;
printf("[join] %s join << %d.%d.%d %d:%d %d", PlayerName(playerid), TimeNow[5],TimeNow[4],TimeNow[3],TimeNow[0],TimeNow[1],TimeNow[2]);
nochat[playerid]=0;
new adminname[MAX_PLAYER_NAME];
GetPlayerName(playerid,adminname,sizeof(adminname));
format(str, 256, "%s.dfu", udb_decode(PlayerName(playerid)));
if(dini_Exists(str)){
new File:Cfg;
Cfg = fopen(str, io_read);
new string[512];
fread(Cfg, string);
new idx2;
strtok(string, idx2);
if(strfind(string, "type=admin")!=-1)isPlayerAdminEx[playerid]=1;
GivePlayerMoney(playerid, strval(strtok(string, idx2)));
bank[playerid] = strval(strtok(string, idx2));
bounty[playerid] = strval(strtok(string, idx2));
PlayerSpawnX[playerid] = floatstr(strtok(string, idx2));
PlayerSpawnY[playerid] = floatstr(strtok(string, idx2));
PlayerSpawnZ[playerid] = floatstr(strtok(string, idx2));
PlayerSpawnA[playerid] = floatstr(strtok(string, idx2));
PlayerSpawnI[playerid] = strval(strtok(string, idx2));
PlayerSpawned[playerid] = 10;
for(new f=0;f<6;f++){PlayerSpawnWeapon[playerid][f][0] = strval(strtok(string, idx2)); PlayerSpawnWeapon[playerid][f][1] = strval(strtok(string, idx2));}
if(isPlayerAdminEx[playerid]){
SendClientMessage(playerid, CWARN, "*** You are an Administrator, please login \"/loginname [password]\" (without \" \" and [ ]) To login.");
} else SendClientMessage(playerid, CWARN, "*** See Kasutaja Nimi On Registeeritud - Tee Nii \"/loginname [password]\" (without \" \" and [ ]) To login.");
new pos = strfind(string, "pass=");
new ignore = 0;
for(new x=0;x<strlen(string);x++)
if(!ignore){
if(string[pos+x]!=' '){
pidpasswd[playerid][x]=string[pos+x];
} else ignore = true;
}
pidpasswd[playerid] = strreplace("pass=", "", pidpasswd[playerid]);
pidpasswd[playerid] = strreplace("ass=", "", pidpasswd[playerid]);
pidpasswd[playerid] = strreplace("ss=", "", pidpasswd[playerid]);
pidpasswd[playerid] = strreplace("s=", "", pidpasswd[playerid]);
pidpasswd[playerid] = strreplace("=", "", pidpasswd[playerid]);
pidpasswd[playerid] = strreplace(" ", "", pidpasswd[playerid]);
fclose(Cfg);
} else {
SendClientMessage(playerid, CWARN, "Kui Oled Registeerinud Ennast Tee Jдrgmist: >/loginname (Sinu Salasхna)");
}
if(JoinLeave==1)SetTimerEx("JoinLeaveMSG", 2500, 0, "d", playerid);
gState[playerid] = e_STATE_CONNECTED;
return 1;
}
/*
tostr(int){
new st[256];
format(st, 256, "%d", int);
return st;
}
*/
// OnPlayerDeath
public OnPlayerDeath(playerid, killerid, reason)
{
GameTextForPlayer(playerid, "Zabity!", 2000, 2);
SendDeathMessage(killerid,playerid,reason);
AdvanceSpectators(playerid);
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
new weap[20];
new ammo;
new pickidd;
for(new i=0;i<12;i++){
GetPlayerWeaponData(playerid, i, weap[i], ammo);
if(weap[i] != 0){
pickidd = CreatePickup(weapmod[weap[i]], 4, (X-3.0)+floatdiv(random(600), 100), (Y-3.0)+floatdiv(random(600), 100), Z);
SetTimerEx("PickDestroy", 5000, 0, "d", pickidd);
}
}
if(killerid != 255){
new weaponname[256];
if(reason == 18)weaponname = "Molotov"; else
GetWeaponName(reason, weaponname, 256);
ToLog("kills","%s killed %s using %s", PlayerName(killerid), PlayerName(playerid), weaponname);
new adod = 0;
if(IsPlayerKilling[playerid] != 1)adod+=CheckRestrickedReason(killerid, reason);
adod+=CheckRestrictedKill(playerid, killerid);
if(adod == 0){
new levelzabicia = GetPlayerLevel(playerid);
levelzabicia++;
GivePlayerExp(killerid, 20*levelzabicia, Split(
Split("*** You recived ", tostr(20*levelzabicia) ," experience points for killing somebody "),
PlayerName(playerid),
".")
);
GivePlayerExp(playerid, -50, "You lost 50 experience points because you were killed.");
} else {
GivePlayerExp(killerid, -300, "You lost 300 experience points because you killed somebody unfair.");
}
if(GetPlayerMoney(playerid) <= 7000000){
GivePlayerMoney(killerid, (GetPlayerMoney(playerid)));
}
new tmp[256];
if (!dini_Exists(FILE_TOTALSTAT)) dini_Create(FILE_TOTALSTAT);
tmp = dini_Get(FILE_TOTALSTAT, "kills");
dini_IntSet(FILE_TOTALSTAT, "kills", strval(tmp)+1);
new killedplayer[MAX_PLAYER_NAME];
new string2[256];
if(HideAdmins[playerid] == 1) return;
if(bounty[playerid] > 0 && (playerGang[killerid] == 0 || playerGang[playerid] != playerGang[killerid])) {
GetPlayerName(playerid, killedplayer, sizeof(killedplayer));
format(string2, sizeof(string2), "You recieved %d for killing %s.", bounty[playerid], killedplayer);
SendClientMessage2(killerid, COLOR_GREEN, string2);
GivePlayerMoney(killerid, bounty[playerid]);
new pname[256];pname = PlayerName(playerid);
pname = strreplace("[", "(", pname);
pname = strreplace("[", "(", pname);
pname = strreplace("]", ")", pname);
pname = strreplace("]", ")", pname);
TextDrawSetString(KillTextDraw[killerid], Split(
Split("Zabiles ", pname, "!")
, "~n~i otrzymales za to $", tostr(bounty[playerid])
));
bounty[playerid] = 0;
TextDrawShowForPlayer(killerid, KillTextDraw[killerid]);
SetTimerEx("HideKillDraw", 3000, false, "d", killerid);
} else {
new pname[256];pname = PlayerName(playerid);
pname = strreplace("[", "(", pname);
pname = strreplace("[", "(", pname);
pname = strreplace("]", ")", pname);
pname = strreplace("]", ")", pname);
TextDrawSetString(KillTextDraw[killerid], Split("Zabiles ", pname, "!"));
TextDrawShowForPlayer(killerid, KillTextDraw[killerid]);
SetTimerEx("HideKillDraw", 3000, false, "d", killerid);
}
} else {
new tmp[256];
ToLog("kills","%s has suicided", PlayerName(playerid));
if (!dini_Exists(FILE_TOTALSTAT)) dini_Create(FILE_TOTALSTAT);
tmp = dini_Get(FILE_TOTALSTAT, "suicides");
dini_IntSet(FILE_TOTALSTAT, "suicides", strval(tmp)+1);
}
ToLog("KillsZysk", "Player: %s earned %d because he killed: %s", PlayerName(killerid), GetPlayerMoney(playerid), PlayerName(playerid));
GivePlayerMoney(playerid, -((GetPlayerMoney(playerid))));
new tmp[256];
if (!dini_Exists(FILE_TOTALSTAT)) dini_Create(FILE_TOTALSTAT);
tmp = dini_Get(FILE_TOTALSTAT, "deaths");
dini_IntSet(FILE_TOTALSTAT, "deaths", strval(tmp)+1);
if(killspawn)
{
GetPlayerPos(playerid, killX, killY, killZ);
}
IsPlayerKilling[playerid] = 0;
}
forward HideKillDraw(playerid);
public HideKillDraw(playerid)TextDrawHideForPlayer(playerid, KillTextDraw[playerid]);
// OnPlayerDisconnect