Help me please thanks
#1

Well i made a server. All i need is anti- tema kill.. by this i mean- so players wont be able to kill eachother..

can i have a code ?

and also...
Is there a way for admins to see a person ip when he leaves like... {"player" left Ip:857485745} like for every player.....
Reply
#2

pawn Код:
//ANTI TEAMKILL
public OnGameModeInit()
{
  SetTimer("UpdateTeams", 1000, 1);
  return 1;
}

forward UpdateTeams();
public  UpdateTeams()
{
  for(new i = 0; i<GetMaxPlayers(); i++)
  {
   if(gTeam[i] == 1) { SetPlayerTeam(playerid, 1); }
   else if(gTeam[i] == 2) { SetPlayerTeam(playerid, 2); }
  }
}
For IP:
https://sampwiki.blast.hk/wiki/GetPlayerIp
Reply
#3

Add this on OnPlayerDisconnect or whatever you use to show player disconnections.

Код:
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			if (player admin / rank ; whatever you use to get your player admin status)
			{
			  new playerip[20];
				new playername[MAX_PLAYER_NAME];
				new string[256];
				GetPlayerName(playerid, playername, sizeof(playername));
				GetPlayerIp(playerid, playerip, sizeof(playerip));
				SendClientMessage(i, your desired color, "%s has left the game. IP: %s.", playername, playerip);
			}
		}
		return 1;
	}
That should work, but I won't guarantee it. I suck at coding sometimes.
Reply
#4

hey guys can u put the codes in for me... whenever i try to post them in i get over 6 errors, i cant resolve... noob scripter, my friend scripts but he left to mexico for 2 motnhs

http://pastebin.com/d29abc786 my gamemode
Reply
#5

Код:
// top of your gamemode
forward SettingPlayerTeam();
//OnPlayerConnect
SetTimerEx("SettingPlayerTeam",10,1,"d",playerid);
//Bottom of your script
public SettingPlayerTeam()
{
  for(new playerid; playerid < 200; playerid++)
    SetPlayerTeam(playerid, gTeam[playerid]);
  return 1;
}



i found this from seif
Reply
#6

what do i do if it says: "error 021: symbol already defined: "SetTimerEx"
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)