Need help in WorldTime
#1

Hi there! I have my own server and I was playing on it, I noticed that, when someone dies, his time goes 6 hours advance. I would want that to stop. I want the time to be same for all players. Like if I have 13:00, I want everyone else to have same time as me.

I noticed that in other server, that players have the same time, but It don't happen in my server. Please help me!

Thanks.

EDIT: I am using SFCRRPG Gamemode
Reply
#2

Show us the OnPlayerDeath callback.
Reply
#3

Edit: I am using SFCRRPG

And one min, I'll show you
Reply
#4

****** will give me a Infraction, if I reply, he thinks I am bumping, but if no one helps, me. I have to ask for help. This Forum, isn't even helping new scriptors. So why you guys make a tab named "Scripting Help", where no one helps you!
Reply
#5

Quote:
Originally Posted by ******
And are we supposed to guess your code?
^^^^
Reply
#6

Here you go!

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new pname[24];
	new killername[24];
	new string[128];
	
	//Get the names
	GetPlayerName(playerid,pname,sizeof(pname));
	GetPlayerName(killerid,killername,sizeof(killername));

	//Reset Death Variables
	IsSpawned[playerid] =0;
	IsFrozen[playerid] =0;
	CanChooseSkill[playerid] =0;
	HasWeed[playerid] =0;
	HasLawEnforcementRadio[playerid] =0;
	gPlayerUsingLoopingAnim[playerid] =0;
	IsCuffed[playerid] =0;
	JailTime[playerid] =0;
	AttemptedToCuffRecently[playerid] =0;
	HasTicket[playerid] =0;
	TimeToPayTicket[playerid] =0;
	playerCheckpoint[playerid] =0;
	TotalJailTime[playerid] =0;
	LastVehicle[playerid] =0;
	CuffTime[playerid] =0;
	IsDetained[playerid] =0;
	MessageTDTime[playerid] =0;
	HasBeenReportedRecently[playerid] =0;
	StoppedSatViewing[playerid] =0;
	IsTackled[playerid] =0;
	HasRope[playerid] =0;
	HasScissors[playerid] =0;
	HasSausageRolls[playerid] =0;
	HasAntiSTI[playerid] =0;
	HasSecureWallet[playerid] =0;
	HasNeedleAndSyringe[playerid] =0;
	InAdminMode[playerid] =0;
	CalledForMedic[playerid] =0;
	CalledForMechanic[playerid] =0;
	CalledForDrugDealer[playerid] =0;
	CalledForTaxi[playerid] =0;
	CalledForWeaponDealer[playerid] =0;
	HasSTI[playerid] =0;
	PayingTaxi[playerid] =0;
	HasTaxiFare[playerid] =-1;
	OnDuty[playerid] =0;
	HasRapedRecently[playerid] =0;
	SmokingWeed[playerid] =0;
	InjectedHeroin[playerid] =0;
	RobbingDrugHouse[playerid] =0;
	RobbingSupaSave[playerid] =0;
	GivenWeaponRecently[playerid] =0;
	IsKidnapped[playerid] =0;
	AttemptedToKidnapRecently[playerid] =0;
	HasKidnappedRecently[playerid] =0;
	AttemptedToRobRecently[playerid] =0;
	HasRobbedRecently[playerid] =0;
	RobbingOtto[playerid] =0;
	HasC4[playerid] =0;
	HasBlownVehicleRecently[playerid] =0;
	IsPlantingCIABuilding[playerid] =0;
	IsPlantingCIASat[playerid] =0;
	IsPlantingCIABridge[playerid] =0;
	RobbingGarciaBurgerShot[playerid] =0;
	RobbingDownBurgerShot[playerid] =0;
	RobbingJHBurgerShot[playerid] =0;
	RobbingOceanCluckinBell[playerid] =0;
	RobbingDownCluckinBell[playerid] =0;
	RobbingAmmunation[playerid] =0;
	RobbingGayDar[playerid] =0;
	RobbingZero[playerid] =0;
	RobbingMistys[playerid] =0;
	RobbingGYM[playerid] =0;
	RobbingSchool[playerid] =0;
	RobbingWang[playerid] =0;
	RobbingTrain[playerid] =0;
	RobbingBarbers[playerid] =0;
	RobbingHospital[playerid] =0;
	RobbingJizzys[playerid] =0;
	RobbingEsplanadePizza[playerid] =0;
	RobbingFinancialPizza[playerid] =0;
	RobbingDownZip[playerid] =0;
	RobbingDownVictim[playerid] =0;
	RobbingJHBinco[playerid] =0;
	RobbingCityHall[playerid] =0;
	
	//Do extra things to the player.
	TextDrawHideForPlayer(playerid,LocationTD[playerid]);
	new mrand =(2000);
	format(string,sizeof(string),"The hospital has charged you $%d for your medical services.",mrand);
	SendClientMessage(playerid,COLOR_PINK,string);
	GivePlayerMoney(playerid,-mrand);
	SetPlayerDrunkLevel(playerid,0);
	TextDrawHideForPlayer(playerid,JailTimer[playerid]);
	
	//Remove things.
	if (PlayerInfo[playerid][pRoadblock] != 0)
	{
		RemoveRoadblock(playerid);
	}
	
	//Message the server (Death reasons: Must always be at the end of OnPlayerDeath)
	if(HasHit[playerid] >= 1)
	{
	    format(string,sizeof(string),"[DEATH] %s(%d) has been killed by %s(%d) for a hit contract.",PlayerName(playerid),playerid,PlayerName(killerid),killerid);
	    SendClientMessageToAll(COLOR_PINK,string);
	    format(string,sizeof(string),"13[DEATH] %s(%d) has been killed by %s(%d) for a hit contract.",PlayerName(playerid),playerid,PlayerName(killerid),killerid);
	    IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
	    
	    GivePlayerMoney(killerid,HitMoney[playerid]);
	    SendClientMessage(killerid,COLOR_DEADCONNECT,"[[_Contract Kill_]]");
	    format(string,sizeof(string),"You have killed %s(%d) for a hit contract and recieved $%d for the kill.",PlayerName(playerid),playerid,HitMoney[playerid]);
	    SendClientMessage(killerid,COLOR_ROBBERY,string);
		IncreaseWantedLevel(killerid,20);
		
		format(string,sizeof(string),"[POLICE RADIO] Suspect %s(%d) has murdered %s(%d) and has been caught on CCTV. Arrest the suspect ASAP.",killername,killerid,pname,playerid);
  		SendClientMessageToAllCops(string);
  		
  		HasHit[playerid] =0;
  		HitMoney[playerid] =0;
  		SetPlayerColor(playerid,COLOR_DEADCONNECT);
		SetPlayerWantedLevel(playerid,0);
		SendDeathMessage(killerid,playerid,reason);
  		return 1;
	}
	if(DiedFromSTI[playerid] == 1)
	{
	    DiedFromSTI[playerid] =0;
	    SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
		SetPlayerColor(playerid,COLOR_DEADCONNECT);
		SetPlayerWantedLevel(playerid,0);
	    return 1;
	}
	if(HasUsedDeath[playerid] == 1)
	{
	    format(string,sizeof(string),"[DEATH] %s(%d) Has taken an overdose on pills and killed themself.",pname,playerid);
		SendClientMessageToAll(COLOR_PINK,string);
		format(string,sizeof(string),"13[DEATH] %s(%d) Has taken an overdose on pills and killed themself.",pname,playerid);
		IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
		HasUsedDeath[playerid] =0;
		DecreasePlayerScore(playerid,1);
		SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
		SetPlayerColor(playerid,COLOR_DEADCONNECT);
		SetPlayerWantedLevel(playerid,0);
	    return 1;
	}
	if(AdminKilled[playerid] == 1)
	{
	    AdminKilled[playerid] =0;
	    SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
	    SetPlayerColor(playerid,COLOR_DEADCONNECT);
		SetPlayerWantedLevel(playerid,0);
	    return 1;
	}
	if(InAdminMode[killerid] == 1)
	{
	    format(string,sizeof(string),"[ADMIN KILL] Administrator %s(%d) has killed %s(%d) while in admin mode.",killername,killerid,pname,playerid);
	    SendClientMessageToAll(COLOR_ADMIN,string);
	    SetPlayerColor(playerid,COLOR_DEADCONNECT);
		SetPlayerWantedLevel(playerid,0);
		SendDeathMessage(killerid,playerid,reason);
		return 1;
	}
	if(IsPlayerConnected(killerid))
	{
	    if(gTeam[killerid] >= 6)
	    {
	        if(JailTime[killerid] == 0)
	        {
	            SendClientMessage(killerid,COLOR_DEADCONNECT,"[[_Murder_]]");
	            format(string,sizeof(string),"You have murdered %s(%d) and have been caught on CCTV. The police have been informed.",pname,playerid);
	            SendClientMessage(killerid,COLOR_ROBBERY,string);
	            IncreaseWantedLevel(killerid,15);
	            SetPlayerWantedLevel(playerid,0);
	            SendDeathMessage(killerid,playerid,reason);
	            
	            format(string,sizeof(string),"[POLICE RADIO] Suspect %s(%d) has murdered %s(%d) and has been caught on CCTV. Arrest the suspect ASAP.",killername,killerid,pname,playerid);
	            SendClientMessageToAllCops(string);
	            return 1;
			}
			if(JailTime[killerid] >= 1)
			{
			    SendClientMessage(killerid,COLOR_DEADCONNECT,"[[_Jail Fight_]]");
			    SendClientMessage(killerid,COLOR_RED,"You have been caught by the security guards in a jail fight. You have recieved an extra jail sentence.");
				JailTime[killerid] +=60;
				SetPlayerWantedLevel(playerid,0);
				SendDeathMessage(killerid,playerid,reason);
				return 1;
			}
		}
		if(gTeam[killerid] == TEAM_COP && gTeam[playerid] != TEAM_ARMY && gTeam[playerid] != TEAM_CIA)
		{
		    if(GetPlayerWantedLevel(playerid) < 4)
		    {
		        SendClientMessage(killerid,COLOR_ROYALBLUE,"[INNOCENT KILL] Do not kill innocent players .. (White/Yellow) Only shoot at Oranges and reds.");
		        SendClientMessage(killerid,COLOR_ROYALBLUE,"This is not a DM server. Please read our /rules and our /pc for a list of player colours.");
                SetPlayerWantedLevel(playerid,0);
                SendDeathMessage(killerid,playerid,reason);
                return 1;
			}
			if(GetPlayerWantedLevel(playerid) >= 4 && GetPlayerWantedLevel(playerid) < 20)
			{
				format(string,sizeof(string),"[POLICE ACTION] Police Officer %s(%d) has taken down Wanted suspect %s(%d) by a %s",killername,killerid,pname,playerid,aWeaponNames[reason]);
				SendClientMessageToAll(COLOR_DODGERBLUE,string);
				
				SetPlayerWantedLevel(playerid,0);
				SendDeathMessage(killerid,playerid,reason);
				
				SendClientMessage(killerid,COLOR_LIGHTBLUE,"You have recieved $2000 for taking down the wanted suspect.");
				GivePlayerMoney(killerid,2000);
				return 1;
			}
			if(GetPlayerWantedLevel(playerid) >= 4 && GetPlayerWantedLevel(playerid) < 30)
			{
				format(string,sizeof(string),"[POLICE ACTION] Police Officer %s(%d) has taken down Wanted suspect %s(%d) by a %s",killername,killerid,pname,playerid,aWeaponNames[reason]);
				SendClientMessageToAll(COLOR_DODGERBLUE,string);
				
				SetPlayerWantedLevel(playerid,0);
				SendDeathMessage(killerid,playerid,reason);

				SendClientMessage(killerid,COLOR_LIGHTBLUE,"You have recieved $5000 for taking down the wanted suspect.");
				GivePlayerMoney(killerid,5000);
				return 1;
			}
			if(GetPlayerWantedLevel(playerid) >= 30 && GetPlayerWantedLevel(playerid) < 40)
			{
				format(string,sizeof(string),"[POLICE ACTION] Police Officer %s(%d) has taken down the Most Wanted suspect %s(%d) by a %s",killername,killerid,pname,playerid,aWeaponNames[reason]);
				SendClientMessageToAll(COLOR_DODGERBLUE,string);
				
				SetPlayerWantedLevel(playerid,0);
				SendDeathMessage(killerid,playerid,reason);

				SendClientMessage(killerid,COLOR_LIGHTBLUE,"You have recieved $8000 for taking down the most wanted suspect.");
				GivePlayerMoney(killerid,800);
				return 1;
			}
			if(GetPlayerWantedLevel(playerid) >= 40)
			{
				format(string,sizeof(string),"[POLICE ACTION] Police Officer %s(%d) has taken down the Maniac %s(%d) by a %s",killername,killerid,pname,playerid,aWeaponNames[reason]);
				SendClientMessageToAll(COLOR_DODGERBLUE,string);
				
				SetPlayerWantedLevel(playerid,0);
				SendDeathMessage(killerid,playerid,reason);

				SendClientMessage(killerid,COLOR_LIGHTBLUE,"You have recieved $12000 for taking down the Maniac by force.");
				GivePlayerMoney(killerid,12000);
				return 1;
			}
		}
		if(gTeam[killerid] == TEAM_ARMY && gTeam[playerid] != TEAM_COP && gTeam[playerid] != TEAM_CIA)
		{
		    if(GetPlayerWantedLevel(playerid) < 4)
		    {
		        SendClientMessage(killerid,COLOR_ROYALBLUE,"[INNOCENT KILL] Do not kill innocent players .. (White/Yellow) Only shoot at Oranges and reds.");
		        SendClientMessage(killerid,COLOR_ROYALBLUE,"This is not a DM server. Please read our /rules and our /pc for a list of player colours.");
                SetPlayerWantedLevel(playerid,0);
                SendDeathMessage(killerid,playerid,reason);
                return 1;
			}
			if(GetPlayerWantedLevel(playerid) >= 4 && GetPlayerWantedLevel(playerid) < 20)
			{
				format(string,sizeof(string),"[POLICE ACTION] Army Officer %s(%d) has taken down Wanted suspect %s(%d) by a %s",killername,killerid,pname,playerid,aWeaponNames[reason]);
				SendClientMessageToAll(COLOR_DODGERBLUE,string);
				
				SetPlayerWantedLevel(playerid,0);
				SendDeathMessage(killerid,playerid,reason);

				SendClientMessage(killerid,COLOR_LIGHTBLUE,"You have recieved $2000 for taking down the wanted suspect.");
				GivePlayerMoney(killerid,2000);
				return 1;
			}
			if(GetPlayerWantedLevel(playerid) >= 4 && GetPlayerWantedLevel(playerid) < 30)
			{
				format(string,sizeof(string),"[POLICE ACTION] Army Officer %s(%d) has taken down Wanted suspect %s(%d) by a %s",killername,killerid,pname,playerid,aWeaponNames[reason]);
				SendClientMessageToAll(COLOR_DODGERBLUE,string);
				
				SetPlayerWantedLevel(playerid,0);
				SendDeathMessage(killerid,playerid,reason);

				SendClientMessage(killerid,COLOR_LIGHTBLUE,"You have recieved $5000 for taking down the wanted suspect.");
				GivePlayerMoney(killerid,5000);
				return 1;
			}
			if(GetPlayerWantedLevel(playerid) >= 30 && GetPlayerWantedLevel(playerid) < 40)
			{
				format(string,sizeof(string),"[POLICE ACTION] Army Officer %s(%d) has taken down the Most Wanted suspect %s(%d) by a %s",killername,killerid,pname,playerid,aWeaponNames[reason]);
				SendClientMessageToAll(COLOR_DODGERBLUE,string);
				
				SetPlayerWantedLevel(playerid,0);
				SendDeathMessage(killerid,playerid,reason);

				SendClientMessage(killerid,COLOR_LIGHTBLUE,"You have recieved $8000 for taking down the most wanted suspect.");
				GivePlayerMoney(killerid,8000);
				return 1;
			}
			if(GetPlayerWantedLevel(playerid) >= 40)
			{
				format(string,sizeof(string),"[POLICE ACTION] Army Officer %s(%d) has taken down the Maniac %s(%d) by a %s",killername,killerid,pname,playerid,aWeaponNames[reason]);
				SendClientMessageToAll(COLOR_DODGERBLUE,string);
				
				SetPlayerWantedLevel(playerid,0);
				SendDeathMessage(killerid,playerid,reason);

				SendClientMessage(killerid,COLOR_LIGHTBLUE,"You have recieved $12000 for taking down the Maniac by force.");
				GivePlayerMoney(killerid,12000);
				return 1;
			}
		}
		if(gTeam[killerid] == TEAM_CIA && gTeam[playerid] != TEAM_ARMY && gTeam[playerid] != TEAM_COP)
		{
		    if(GetPlayerWantedLevel(playerid) < 4)
		    {
		        SendClientMessage(killerid,COLOR_ROYALBLUE,"[INNOCENT KILL] Do not kill innocent players .. (White/Yellow) Only shoot at Oranges and reds.");
		        SendClientMessage(killerid,COLOR_ROYALBLUE,"This is not a DM server. Please read our /rules and our /pc for a list of player colours.");
                SetPlayerWantedLevel(playerid,0);
                SendDeathMessage(killerid,playerid,reason);
                return 1;
			}
			if(GetPlayerWantedLevel(playerid) >= 4 && GetPlayerWantedLevel(playerid) < 20)
			{
				format(string,sizeof(string),"[POLICE ACTION] CIA Agent %s(%d) has taken down Wanted suspect %s(%d) by a %s",killername,killerid,pname,playerid,aWeaponNames[reason]);
				SendClientMessageToAll(COLOR_DODGERBLUE,string);
				
				SetPlayerWantedLevel(playerid,0);
				SendDeathMessage(killerid,playerid,reason);

				SendClientMessage(killerid,COLOR_LIGHTBLUE,"You have recieved $2000 for taking down the wanted suspect.");
				GivePlayerMoney(killerid,2000);
				return 1;
			}
			if(GetPlayerWantedLevel(playerid) >= 4 && GetPlayerWantedLevel(playerid) < 30)
			{
				format(string,sizeof(string),"[POLICE ACTION] CIA Agent %s(%d) has taken down Wanted suspect %s(%d) by a %s",killername,killerid,pname,playerid,aWeaponNames[reason]);
				SendClientMessageToAll(COLOR_DODGERBLUE,string);
				
				SetPlayerWantedLevel(playerid,0);
				SendDeathMessage(killerid,playerid,reason);

				SendClientMessage(killerid,COLOR_LIGHTBLUE,"You have recieved $5000 for taking down the wanted suspect.");
				GivePlayerMoney(killerid,5000);
				return 1;
			}
			if(GetPlayerWantedLevel(playerid) >= 30 && GetPlayerWantedLevel(playerid) < 40)
			{
				format(string,sizeof(string),"[POLICE ACTION] CIA Agent %s(%d) has taken down the Most Wanted suspect %s(%d) by a %s",killername,killerid,pname,playerid,aWeaponNames[reason]);
				SendClientMessageToAll(COLOR_DODGERBLUE,string);
				
				SetPlayerWantedLevel(playerid,0);
				SendDeathMessage(killerid,playerid,reason);

				SendClientMessage(killerid,COLOR_LIGHTBLUE,"You have recieved $8000 for taking down the most wanted suspect.");
				GivePlayerMoney(killerid,8000);
				return 1;
			}
			if(GetPlayerWantedLevel(playerid) >= 40)
			{
				format(string,sizeof(string),"[POLICE ACTION] CIA Agent %s(%d) has taken down the Maniac %s(%d) by a %s",killername,killerid,pname,playerid,aWeaponNames[reason]);
				SendClientMessageToAll(COLOR_DODGERBLUE,string);
				
				SetPlayerWantedLevel(playerid,0);
				SendDeathMessage(killerid,playerid,reason);

				SendClientMessage(killerid,COLOR_LIGHTBLUE,"You have recieved $12000 for taking down the Maniac by force.");
				GivePlayerMoney(killerid,12000);
				return 1;
			}
		}
		if(gTeam[killerid] == TEAM_COP || gTeam[killerid] == TEAM_ARMY || gTeam[killerid] == TEAM_CIA)
		{
		    if(TeamKillWarning[killerid] < 2)
		    {
			    SendClientMessage(killerid,COLOR_ORANGE,"DO NOT TEAMKILL IN THIS SERVER. IT IS NOT ALLOWED.");
			    SendClientMessage(killerid,COLOR_ORANGE,"You cannot teamkill. Please read /rules and /pc for a list of rules and player colours in this server.");

                format(string,sizeof(string),"13[DEATH] %d%s(%d) Has been killed by %d%s(%d) by a %s",IrcColor[playerid],pname,playerid,IrcColor[killerid],killername,killerid,aWeaponNames[reason]);
				IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
				TeamKillWarning[killerid] ++;
				SetPlayerColor(playerid,COLOR_DEADCONNECT);
				SetPlayerWantedLevel(playerid,0);
				SendDeathMessage(killerid,playerid,reason);
			    return 1;
			}
			if(TeamKillWarning[killerid] == 2)
			{
			    format(string,sizeof(string),"[AUTO KICK] %s(%d) too many warnings for teamkilling other players. [3/3]",killername,killerid);
			    SendClientMessageToAll(COLOR_ADMIN,string);
			    
			    format(string,sizeof(string),"9[AUTO KICK] %s(%d) too many warnings for teamkilling other players. [3/3]",killername,killerid);
				IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
				
				format(string,sizeof(string),"13[DEATH] %d%s(%d) Has been killed by %d%s(%d) by a %s",IrcColor[playerid],pname,playerid,IrcColor[killerid],killername,killerid,aWeaponNames[reason]);
				IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
				TeamKillWarning[killerid] =0;
				Kicking[killerid] =1;
				SetTimer("KickPlayer",700,0);
				SetPlayerColor(playerid,COLOR_DEADCONNECT);
				SetPlayerWantedLevel(playerid,0);
				SendDeathMessage(killerid,playerid,reason);
				return 1;
			}
		}
		if(gTeam[killerid] != TEAM_COP && gTeam[killerid] != TEAM_ARMY && gTeam[killerid] != TEAM_CIA)
		{
			format(string,sizeof(string),"[DEATH] %s(%d) Has been killed by %s(%d) by a %s",pname,playerid,killername,killerid,aWeaponNames[reason]);
			SendClientMessageToAll(COLOR_PINK,string);
			SetPlayerWantedLevel(playerid,0);
		}
		format(string,sizeof(string),"13[DEATH] %d%s(%d) Has been killed by %d%s(%d) by a %s",IrcColor[playerid],pname,playerid,IrcColor[killerid],killername,killerid,aWeaponNames[reason]);
		IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
		SendDeathMessage(killerid,playerid,reason);
		SetPlayerWantedLevel(playerid,0);
	}
	if(!IsPlayerConnected(killerid))
	{
	    format(string,sizeof(string),"[DEATH] %s(%d) Has killed themselves .. (For some odd reason)",pname,playerid);
	    SendClientMessageToAll(COLOR_PINK,string);
	    format(string,sizeof(string),"13[DEATH] %s(%d) Has killed themselves .. (For some odd reason)",pname,playerid);
	    IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
	    SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
	    SetPlayerWantedLevel(playerid,0);
	}
	SetPlayerColor(playerid,COLOR_DEADCONNECT);
	SetPlayerWantedLevel(playerid,0);
	return 1;
}
Reply
#7

Well I just will post this link

https://sampwiki.blast.hk/wiki/TogglePlayerClock

You should read the second note
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)