SA-MP Forums Archive
help plz - 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 plz (/showthread.php?tid=150828)



help plz - leociclon - 28.05.2010

hiii, help plz

add this




Re: help plz - russo666 - 28.05.2010

Quote:
Originally Posted by Pixels^
Connect icon in DeathStats from ******
pawn Код:
public OnPlayerConnect(playerid)
{
   SendDeathMessage(playerid, INVALID_PLAYER_ID, 200);
   return 1;
}

Disconnect icon in DeathStats from ******
pawn Код:
public OnPlayerDisconnect(playerid)
{
  SendDeathMessage(INVALID_PLAYER_ID, playerid, 201);
}
Kills:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  SendDeathMessage(killerid, playerid, reason);
  return 1;
}



Re: help plz - leociclon - 28.05.2010

no death

joined or exit




Re: help plz - (SF)Noobanatior - 28.05.2010

can you post the script
or OnPlayerConnect OnPlayerDisconnect and On Death


Re: help plz - leociclon - 28.05.2010

ok here the code

Код:
public OnPlayerConnect(playerid) {
	new string[256],PlayerName[24],file[256]; file = GetPlayerFile(playerid);
	GetPlayerName(playerid,PlayerName,24); if(!dini_Exists(file)) CreateUserConfigFile(playerid);
	for(new i = 0; i < 100; i++) {
	  if(strfind(PlayerName,ForbidNames[i],true)!=-1 && Config[ForbidData]) {
			switch(Config[ForbidData]) { case 1: Kick(playerid); case 2: Ban(playerid); }
			return 1;
		}
	}
and

Код:
public OnPlayerDisconnect(playerid,reason) {
	new Reason[256],string[256],name[24]; GetPlayerName(playerid,name,24);
	switch(reason) { case 0: Reason = "Timed Out"; case 1: Reason = "Leaving"; case 2: Reason = "Kick/Ban"; }
	format(string,256,"*** %s has left the server. (%s)",name,Reason);
	for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && i != playerid) SendClientMessage(i,grey,string);
  for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && Spec[i][SpectateID] == playerid && Spec[i][Spectating]) { TogglePlayerSpectating(i,false); Spec[i][Spectating] = false, Spec[i][SpectateID] = INVALID_PLAYER_ID; }
	return 1;
}



Re: help plz - (SF)Noobanatior - 28.05.2010

so add SendDeathMessage(killer,killee,weapon) into them to get it to do it when them things happen
Код:
public OnPlayerConnect(playerid) {
    SendDeathMessage(playerid, INVALID_PLAYER_ID, 200);
	new string[256],PlayerName[24],file[256]; file = GetPlayerFile(playerid);
	GetPlayerName(playerid,PlayerName,24); if(!dini_Exists(file)) CreateUserConfigFile(playerid);
	for(new i = 0; i < 100; i++) {
	  if(strfind(PlayerName,ForbidNames[i],true)!=-1 && Config[ForbidData]) {
			switch(Config[ForbidData]) { case 1: Kick(playerid); case 2: Ban(playerid); }
			return 1;
		}
	}
and do the same for OnPlayerDeath and OnPlayerDisconnect