pawn Код:
public OnPlayerConnect(playerid)
{
TextDrawShowForPlayer(playerid, TextdrawConnect0);
TextDrawShowForPlayer(playerid, TextdrawConnect1);
TextDrawShowForPlayer(playerid, TextdrawConnect2);
TextDrawShowForPlayer(playerid, TextdrawConnect3);
TextDrawShowForPlayer(playerid, TextdrawConnect4);
TextDrawShowForPlayer(playerid, TextdrawConnect5);
TextDrawShowForPlayer(playerid, TextdrawConnect6);
TextDrawShowForPlayer(playerid, TextdrawConnect7);
TextDrawShowForPlayer(playerid, TextdrawConnect8);
TextDrawShowForPlayer(playerid, TextdrawConnect9);
TextDrawShowForPlayer(playerid, TextdrawConnect10);
TextDrawShowForPlayer(playerid, TextdrawConnect11);
TextDrawShowForPlayer(playerid, TextdrawConnect12);
TextDrawShowForPlayer(playerid, TextdrawConnect13);
TextDrawShowForPlayer(playerid, TextdrawConnect14);
TextDrawShowForPlayer(playerid, TextdrawConnect15);
TextDrawShowForPlayer(playerid, TextdrawConnect16);
TextDrawShowForPlayer(playerid, TextdrawConnect17);
TextDrawShowForPlayer(playerid, TextdrawConnect18);
TextDrawShowForPlayer(playerid, TextdrawConnect19);
if(IsGameStarted == 1)
{
SetVehicleParamsForPlayer(ExportVehicle, playerid, 1, 0);
new string[128];
SendClientMessage(playerid, COLOR_YELLOW, "We are currently playing an Export-Game!");
format(string, sizeof(string), "The first one who delivers the %s indicated with yellow marker, wins the value of it ($%d,-)", VehNames[GetVehicleModel(ExportVehicle) - 400], ExportVehicleValue);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
PlayerVehicle[playerid] = 0;
KillStreak[playerid] = 0;
Posaved[playerid] = 0;
Act[playerid] = 0;
new playrname[MAX_PLAYER_NAME];
PreloadAnimLib(playerid,"BOMBER");
PreloadAnimLib(playerid,"RAPPING");
PreloadAnimLib(playerid,"SHOP");
PreloadAnimLib(playerid,"BEACH");
PreloadAnimLib(playerid,"SMOKING");
PreloadAnimLib(playerid,"FOOD");
PreloadAnimLib(playerid,"ON_LOOKERS");
PreloadAnimLib(playerid,"DEALER");
PreloadAnimLib(playerid,"CRACK");
PreloadAnimLib(playerid,"CARRY");
PreloadAnimLib(playerid,"COP_AMBIENT");
PreloadAnimLib(playerid,"PARK");
PreloadAnimLib(playerid,"INT_HOUSE");
PreloadAnimLib(playerid,"FOOD");
PreloadAnimLib(playerid,"PED");
PlayerInfo[playerid][SpawnDance] = true;
/////Fire ghost rider
fireinfo[playerid] = 0;
new n[32];
new s[128];
GetPlayerName(playerid, n, 32);
format(s,128,"~r~%s ~w~Has Joined The Server.",n);
TextDrawSetString(Con, s);
TextDrawShowForAll(Con);
SetTimer("texthide",5000,false);
// Set the default speed boost for the player
// (the previous player may of changed it)
SpeedBoostMultiplier[playerid] = 1.5;
SetPlayerArmour(playerid, 100);
SetTimerEx("Autorepair",500,true,"d",playerid);
countpos[playerid] = 0;
if(IsPlayerNPC(playerid)) return 1;
AutoRepairUsed[playerid] = 0;
AutoRepairTrigger[playerid] = 0;
gActivePlayers[playerid]++;
gLastGaveCash[playerid] = GetTickCount();
playerCheckpoint[playerid]=999;
bank[playerid]=0;
playerGang[playerid]=0;
gangInvite[playerid]=0;
for(new i = GetMaxPlayers() - 1; i >= 0; --i)
{
if(i == sizeof(RainbowGradient)) RainbowError = 0;
if(IsPlayerConnected(i))
{
SetPlayerColor(i, RainbowGradient[i + RainbowError]);
}
else RainbowError -= 1;
}
GetPlayerName(playerid, playrname, sizeof(playrname));
for(new i = 0; i < MAX_SAVE; i++) {
if(isStringSame(savedNames[i], playrname, MAX_PLAYER_NAME)) {
GivePlayerMoney(playerid, savedInfo[i][0]);
bank[playerid] = savedInfo[i][1];
bounty[playerid] = savedInfo[i][2];
savedInfo[i][0]=savedInfo[i][1]=savedInfo[i][2]=0;
savedNames[i][0]=0;
for(new j = 0; j < MAX_WEAPONS; j++) {
playerWeapons[playerid][j]=savedWeapons[i][j];
savedWeapons[i][j]=0;
}
SendClientMessage(playerid, COLOR_GREEN, "Your money has been restored.");
}
}
PlayerProps[playerid] = 0;
Logged[playerid] = 0;
EarningsForPlayer[playerid] = 0;
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
for(new propid; propid < PropertiesAmount; propid++)
{
if(PropInfo[propid][PropIsBought] == 1)
{
if(strcmp(PropInfo[propid][PropOwner], pName, true)==0)
{
EarningsForPlayer[playerid] += PropInfo[propid][PropEarning];
PlayerProps[playerid]++;
}
}
}
#if ENABLE_LOGIN_SYSTEM == 0
if(PlayerProps[playerid] > 0)
{
new str[128];
format(str, 128, "You currently own %d properties. Type /myproperties for more info about them.", PlayerProps[playerid]);
SendClientMessage(playerid, 0x99FF66AA, str);
}
#endif
return 1;
}
Onplayerconnect code
This is ladmin public ping kick
pawn Код:
forward PingKick();
public PingKick()
{
if(ServerInfo[MaxPing] != 0)
{
PingPos++; if(PingPos > PING_MAX_EXCEEDS) PingPos = 0;
for(new i=0; i<MAX_PLAYERS; i++)
{
PlayerInfo[i][pPing][PingPos] = GetPlayerPing(i);
if(GetPlayerPing(i) > ServerInfo[MaxPing])
{
if(PlayerInfo[i][PingCount] == 0) PlayerInfo[i][PingTime] = TimeStamp();
PlayerInfo[i][PingCount]++;
if(TimeStamp() - PlayerInfo[i][PingTime] > PING_TIMELIMIT)
{
PlayerInfo[i][PingTime] = TimeStamp();
PlayerInfo[i][PingCount] = 1;
}
else if(PlayerInfo[i][PingCount] >= PING_MAX_EXCEEDS)
{
new Sum, Average, x, string[128];
while (x < PING_MAX_EXCEEDS) {
Sum += PlayerInfo[i][pPing][x];
x++;
}
Average = (Sum / PING_MAX_EXCEEDS);
format(string,sizeof(string),"%s has been kicked from the server. (Reason: High Ping (%d) | Average (%d) | Max Allowed (%d) )", PlayerName2(i), GetPlayerPing(i), Average, ServerInfo[MaxPing] );
SendClientMessageToAll(grey,string);
SaveToFile("KickLog",string);
Kick(i);
}
}
else if(GetPlayerPing(i) < 1 && ServerInfo[AntiBot] == 1)
{
PlayerInfo[i][BotPing]++;
if(PlayerInfo[i][BotPing] >= 3) BotCheck(i);
}
else
{
PlayerInfo[i][BotPing] = 0;
}
}
}
#if defined ANTI_MINIGUN
new weap, ammo;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && PlayerInfo[i][Level] == 0)
{
GetPlayerWeaponData(i, 7, weap, ammo);
if(ammo > 1 && weap == 38) {
new string[128]; format(string,sizeof(string),"INFO: %s(%d) has a mingun with %d ammo", PlayerName2(i),i , ammo);
MessageToAdmins(COLOR_WHITE,string);
}
}
}
#endif
}
Crash detect logs
Код:
[17:13:12] [debug] Accessing element at negative index -1
[17:13:12] [debug] AMX backtrace:
[17:13:12] [debug] #0 0001343c in public Itter_OnPlayerConnect () from updatedgm.amx
[17:13:12] [debug] #1 00002d40 in public Streamer_OnPlayerConnect () from updatedgm.amx
[17:13:12] [debug] #2 00002224 in public OnPlayerConnect () from updatedgm.amx
[17:13:35] [debug] Run time error 4: "Array index out of bounds"
[17:13:35] [debug] Accessing element at negative index -1
[17:13:35] [debug] AMX backtrace:
[17:13:35] [debug] #0 00014354 in public Itter_OnPlayerDisconnect () from updatedgm.amx
[17:13:35] [debug] #1 00003064 in public Streamer_OnPlayerDisconnect () from updatedgm.amx
[17:13:35] [debug] #2 000022e0 in public OnPlayerDisconnect () from updatedgm.amx
[17:13:35] [part] kanza200 has left the server (20:0)
[17:13:36] [debug] Run time error 4: "Array index out of bounds"
[17:13:36] [debug] Accessing element at index 4 past array upper bound 3
[17:13:36] [debug] AMX backtrace:
[17:13:36] [debug] #0 00065a1c in public PingKick () from ladmin4v2(4).amx
It keeps on repeating it in logs maybe this can fix server joining stuck thingy help please