Problem with freezing REP++
#1

Problem is when i got killed 4 times my game got freezed and not only for me for all players what is problem fast
Reply
#2

Server crashed (maybe), Post your server_log.txt.
Reply
#3

no no my game got freezed after 3/4 deads, server is not crashed.
Reply
#4

Didn't it help just to relog? Otherwise try to re-install your game.
Reply
#5

I doubt it's a server sided problem. Try posting here your OnPlayerSpawn and OnPlayerDeath classes.
Reply
#6

Probably BulletCrasher is affecting your server. Try updating to 0.3z R4 or 0.3.7
Reply
#7

Quote:
Originally Posted by Mijata
Посмотреть сообщение
no no my game got freezed after 3/4 deads, server is not crashed.
Your game got freezed, What about other players there games also get freezes?

*I hope you know the difference between a game freeze and a server freeze/lag.
Reply
#8

i mean crash player got crashed

Quote:

public OnPlayerDeath(playerid, killerid, reason)
{

if(Captured[playerid][CAPZONE] == 0 && IsPlayerCapturing[playerid][CAPZONE] == 1)
{
LeavingCAPZONE(playerid);
}

Streaks[killerid] += 1;
Streaks[playerid] = 0;
switch(Streaks[killerid]) //IMPORTANT: with the function "switch", you're switching / toggling through the killstreaks of a player (Streals). you need the killerid here, because the playerid is the one which is GETTING killed
{
case 3:
{
format(gString,SOS," %s Has a killing spree (3 kills) (Reward:300$ + 2 score)",GetName(killerid));
SendClientMessageToAll(GREEN, gString);
SetPlayerScore(killerid,GetPlayerScore(killerid)+2 );
GivePlayerMoney(killerid, 300);
SendClientMessage(killerid, GREEN,"You recieved 300$ and +2 scores for your 3 spree!");
}
case 6:
{
format(gString,SOS," %s Has a killing spree (6 kills) (Reward:600$ + 2 score)",GetName(killerid));
SendClientMessageToAll(GREEN, gString);
GivePlayerMoney(killerid, 600);
SetPlayerScore(killerid,GetPlayerScore(killerid)+2 );
SendClientMessage(killerid, GREEN,"You recieved 600$ and +2 scores for your 6 spree!");
}
case 9:
{
format(gString,SOS," %s Has a killing spree (9 kills) (Reward:900$ + 2 score)",GetName(killerid));
SendClientMessageToAll(GREEN, gString);
GivePlayerMoney(killerid, 900);
SetPlayerScore(killerid,GetPlayerScore(killerid)+2 );
SendClientMessage(killerid, GREEN,"You recieved 900$ and +2 scores for your 9 spree!");
}
case 12:
{
format(gString,SOS," %s Has a killing spree (12 kills) (Reward:1000$ + 4 score)",GetName(killerid));
SendClientMessageToAll(GREEN, gString);
SetPlayerScore(killerid,GetPlayerScore(killerid)+4 );
GivePlayerMoney(killerid, 1000);
SendClientMessage(killerid, GREEN,"You recieved 1000$ and +4 scores for your 12 spree!");
}
case 15:
{
format(gString,SOS," %s Has a killing spree (15 kills) (Reward:2500$ + 4 score)",GetName(killerid));
SendClientMessageToAll(GREEN, gString);
SetPlayerScore(killerid,GetPlayerScore(killerid)+4 );
GivePlayerMoney(killerid, 2500);
SendClientMessage(killerid, GREEN,"You recieved 2500$ and +4 scores for your 15 spree!");
}
case 20:
{
format(gString,SOS," %s Has a killing spree (20 kills) (Reward:3500$ + 4 score)",GetName(killerid));
SendClientMessageToAll(GREEN, gString);
SetPlayerScore(killerid,GetPlayerScore(killerid)+4 );
GivePlayerMoney(killerid, 3500);
SendClientMessage(killerid, GREEN,"You recieved 3500$ and +4 scores for your 20 spree!");
}
case 25:
{
format(gString,SOS," %s Has a killing spree (25 kills) (Reward:4000$ + 4 score)",GetName(killerid));
SendClientMessageToAll(GREEN, gString);
SetPlayerScore(killerid,GetPlayerScore(killerid)+4 );
GivePlayerMoney(killerid, 4000);
SendClientMessage(killerid, GREEN,"You recieved 4000$ and +4 scores for your 25 spree!");
}
case 30:
{
format(gString,SOS," %s Has a killing spree (30 kills) (Reward:4500$ + 4 score)",GetName(killerid));
SendClientMessageToAll(GREEN, gString);
SetPlayerScore(killerid,GetPlayerScore(killerid)+4 );
GivePlayerMoney(killerid, 4500);
SendClientMessage(killerid, GREEN,"You recieved 4500$ and +4 scores for your 30 spree!");
}
case 35:
{
format(gString,SOS," %s Has a killing spree (35 kills) (Reward:5000$ + 5 score)",GetName(killerid));
SendClientMessageToAll(GREEN, gString);
SetPlayerScore(killerid,GetPlayerScore(killerid)+5 );
GivePlayerMoney(killerid, 5000);
SendClientMessage(killerid, GREEN,"You recieved 5000$ and +5 scores for your 35 spree!");
}
}


SendDeathMessage(killerid, playerid, reason);

new cash = random(100);
format(gString, 100, "You have killed %s and got 100$ and + 1 score!", PlayerName(playerid), cash);
SendClientMessage(killerid, GREEN, gString);
format(gString, 100, "You have been killed by %s!", PlayerName(killerid));
SendClientMessage(playerid, RED, gString);
SetPlayerScore(killerid,GetPlayerScore(killerid)+1 );
GivePlayerMoney(killerid,100);

pInfo[playerid][Spawned] = 0;
pInfo[playerid][Deaths]++;
if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID)
{
pInfo[killerid][Kills]++;
}
return 1;
}

Quote:

public OnPlayerSpawn(playerid)
{

if(pInfo[playerid][Jailed]==1)
{
SetPlayerInterior(playerid, 3);
SetPlayerPos(playerid,197.5860,174.6970,1003.0234) ;
ResetPlayerWeapons(playerid);
Jtimer[playerid] = SetTimerEx("Unjail",60000,0,"d",playerid);
print("jailed");
}
if(Captured[playerid][CAPZONE] == 0 && IsPlayerCapturing[playerid][CAPZONE] == 1)
{
LeavingCAPZONE(playerid);
}
TextDrawHideForPlayer(playerid, CountText[playerid]);
SetPlayerHealth(playerid, 99999);
SetTimerEx("SpawnProtection", 10000, false, "i", playerid);
SendClientMessage(playerid, RED, "Anti-Spawn kill protection {FFFF00}10 {FFFFFF}seconds!");
SetTimerEx("SpawnProtection1", 3000, false, "i", playerid);
TogglePlayerControllable(playerid, false);
SendClientMessage(playerid, -1, "You are being processed, please wait!");
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
TextDrawHideForPlayer(playerid, Welcome);
TextDrawHideForPlayer(playerid, register1);

GangZoneShowForAll(GZ_ZONE1, T_GZ_COLOR);
GangZoneShowForAll(GZ_ZONE3, T_GZ_COLOR);
GangZoneShowForAll(GZ_ZONE2, C_GZ_COLOR);
GangZoneShowForAll(GZ_ZONE4, 0x00FF4096);
if(gTeam[playerid] == C1) {
new Random = random(sizeof(CSpawns));
SetPlayerPos(playerid, CSpawns[Random][0], CSpawns[Random][1], CSpawns[Random][2]);
SetPlayerFacingAngle(playerid, CSpawns[Random][3]);
SetPlayerTeam(playerid, C1);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, -1, "> Your team is "blue1"Cops {FFFFFF}if you want to change team type {F7EF00}/changeteam!");
SetPlayerColor(playerid, C_COLOR);
}
if(gTeam[playerid] == T1) {
new Random = random(sizeof(TSpawns));
SetPlayerPos(playerid, TSpawns[Random][0], TSpawns[Random][1], TSpawns[Random][2]);
SetPlayerFacingAngle(playerid, TSpawns[Random][3]);
SetPlayerTeam(playerid, T1);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, -1, "> Your team is "red1"Terrorists {FFFFFF}if you want to change team type {F7EF00}/changeteam!");
SetPlayerColor(playerid, T_COLOR);
}
pInfo[playerid][Spawned] = 1;
if(pInfo[playerid][Registered] == 1 && pInfo[playerid][Logged] == 0)
{
ShowPlayerDialog(playerid, JDIALOGS+45, DIALOG_STYLE_MSGBOX," {FB0404}Kicked", "You have been kicked | Reason: \"You must be logged before spawn\"", "Ok", "");
SetTimerEx("KickPlayer",100,false,"d", playerid);
return 0;
}
if(GetPVarInt(playerid,"Useskin") == 1)
{
SetPlayerSkin(playerid, pInfo[playerid][Skin]);
}
return 1;
}

Reply
#9

Actually OnPlayerDeath stops working due to run time error 4. You never check if killerid is valid player before using it in arrays except the last part.

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    
SendDeathMessage(killeridplayeridreason);
    
    if(
Captured[playerid][CAPZONE] == && IsPlayerCapturing[playerid][CAPZONE] == 1)
    {
        
LeavingCAPZONE(playerid);
    }
    
    
Streaks[playerid] = 0;
    
pInfo[playerid][Spawned] = 0;
    
pInfo[playerid][Deaths]++;
    
    if (
killerid != INVALID_PLAYER_ID)
    {
        
pInfo[killerid][Kills]++;
        
Streaks[killerid] += 1;
        switch(
Streaks[killerid]) //IMPORTANT: with the function "switch", you're switching / toggling through the killstreaks of a player (Streals). you need the killerid here, because the playerid is the one which is GETTING killed
        
{
            case 
3:
            {
                
format(gString,SOS," %s Has a killing spree (3 kills) (Reward:300$ + 2 score)",GetName(killerid));
                
SendClientMessageToAll(GREENgString);
                
SetPlayerScore(killerid,GetPlayerScore(killerid)+);
                
GivePlayerMoney(killerid300);
                
SendClientMessage(killeridGREEN,"You recieved 300$ and +2 scores for your 3 spree!");
            }
            case 
6:
            {
                
format(gString,SOS," %s Has a killing spree (6 kills) (Reward:600$ + 2 score)",GetName(killerid));
                
SendClientMessageToAll(GREENgString);
                
GivePlayerMoney(killerid600);
                
SetPlayerScore(killerid,GetPlayerScore(killerid)+);
                
SendClientMessage(killeridGREEN,"You recieved 600$ and +2 scores for your 6 spree!");
            }
            case 
9:
            {
                
format(gString,SOS," %s Has a killing spree (9 kills) (Reward:900$ + 2 score)",GetName(killerid));
                
SendClientMessageToAll(GREENgString);
                
GivePlayerMoney(killerid900);
                
SetPlayerScore(killerid,GetPlayerScore(killerid)+);
                
SendClientMessage(killeridGREEN,"You recieved 900$ and +2 scores for your 9 spree!");
            }
            case 
12:
            {
                
format(gString,SOS," %s Has a killing spree (12 kills) (Reward:1000$ + 4 score)",GetName(killerid));
                
SendClientMessageToAll(GREENgString);
                
SetPlayerScore(killerid,GetPlayerScore(killerid)+);
                
GivePlayerMoney(killerid1000);
                
SendClientMessage(killeridGREEN,"You recieved 1000$ and +4 scores for your 12 spree!");
            }
            case 
15:
            {
                
format(gString,SOS," %s Has a killing spree (15 kills) (Reward:2500$ + 4 score)",GetName(killerid));
                
SendClientMessageToAll(GREENgString);
                
SetPlayerScore(killerid,GetPlayerScore(killerid)+);
                
GivePlayerMoney(killerid2500);
                
SendClientMessage(killeridGREEN,"You recieved 2500$ and +4 scores for your 15 spree!");
            }
            case 
20:
            {
                
format(gString,SOS," %s Has a killing spree (20 kills) (Reward:3500$ + 4 score)",GetName(killerid));
                
SendClientMessageToAll(GREENgString);
                
SetPlayerScore(killerid,GetPlayerScore(killerid)+);
                
GivePlayerMoney(killerid3500);
                
SendClientMessage(killeridGREEN,"You recieved 3500$ and +4 scores for your 20 spree!");
            }
            case 
25:
            {
                
format(gString,SOS," %s Has a killing spree (25 kills) (Reward:4000$ + 4 score)",GetName(killerid));
                
SendClientMessageToAll(GREENgString);
                
SetPlayerScore(killerid,GetPlayerScore(killerid)+);
                
GivePlayerMoney(killerid4000);
                
SendClientMessage(killeridGREEN,"You recieved 4000$ and +4 scores for your 25 spree!");
            }
            case 
30:
            {
                
format(gString,SOS," %s Has a killing spree (30 kills) (Reward:4500$ + 4 score)",GetName(killerid));
                
SendClientMessageToAll(GREENgString);
                
SetPlayerScore(killerid,GetPlayerScore(killerid)+);
                
GivePlayerMoney(killerid4500);
                
SendClientMessage(killeridGREEN,"You recieved 4500$ and +4 scores for your 30 spree!");
            }
            case 
35:
            {
                
format(gString,SOS," %s Has a killing spree (35 kills) (Reward:5000$ + 5 score)",GetName(killerid));
                
SendClientMessageToAll(GREENgString);
                
SetPlayerScore(killerid,GetPlayerScore(killerid)+);
                
GivePlayerMoney(killerid5000);
                
SendClientMessage(killeridGREEN,"You recieved 5000$ and +5 scores for your 35 spree!");
            }
        }
        new 
cash random(100);
        
format(gString100"You have killed %s and got 100$ and + 1 score!"PlayerName(playerid), cash);
        
SendClientMessage(killeridGREENgString);
        
format(gString100"You have been killed by %s!"PlayerName(killerid));
        
SendClientMessage(playeridREDgString);
        
SetPlayerScore(killerid,GetPlayerScore(killerid)+);
        
GivePlayerMoney(killerid,100);
    }
    return 
1;

Reply
#10

dude, again same problem i think something is wrong with onplayerspawn beacuse when i use /spawn myid i again got crash after 3/4 times and it is for all players
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)