no no my game got freezed after 3/4 deads, server is not crashed.
|
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; } |
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; } |
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
if(Captured[playerid][CAPZONE] == 0 && 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(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!");
}
}
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);
}
return 1;
}