Help me please thanks - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help me please thanks (
/showthread.php?tid=84309)
Help me please thanks -
lilstuh - 30.06.2009
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.....
Re: Help me please thanks -
Grim_ - 30.06.2009
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
Re: Help me please thanks -
Kenny990 - 30.06.2009
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.
Re: Help me please thanks -
lilstuh - 01.07.2009
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
Re: Help me please thanks -
Mr_Finnigan - 01.07.2009
Код:
// 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
Re: Help me please thanks -
lilstuh - 01.07.2009
what do i do if it says: "error 021: symbol already defined: "SetTimerEx"