SA-MP Forums Archive
GameForPlayer after killed - 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)
+--- Thread: GameForPlayer after killed (/showthread.php?tid=354386)



GameForPlayer after killed w/image - kbalor - 26.06.2012

If i killed someone text will show like this - GameForPlayer(Textplayerid,"You killed VICTIMS NAME",2000,3); is that possible to get player name using this Gameforplayer?

And if..
I get killed this will show to my screen GameForPlayer(Textplayerid, "You got killed by KILLERNAME",2000,3)

You know what script is this??




Re: GameForPlayer after killed - God'Z War - 26.06.2012

Try This
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	new msg[128],reasonMsg[32], pname[MAX_PLAYER_NAME], string[128], deathreason[20];
	SendDeathMessage(killerid,playerid,reason);
	GameTextForPlayer(playerid,"~r~~h~OWNED",10000,1);
	GetPlayerName(playerid, pname, sizeof(pname));
	GetWeaponName(reason, deathreason, 20);
	new pstring[128]; //player message
	new killer[MAX_PLAYER_NAME];
	GetPlayerName(killerid, killer, sizeof(killer));
 	PlayerInfo[ playerid ][ Deaths ] ++;
	new kstring[128]; //killer message
	GetPlayerName(playerid, pname, sizeof(pname));
	format(kstring, sizeof(kstring), "~b~Haha Ya 0wned %s",pname);
	GameTextForPlayer(killerid, kstring, 4000, 3);
	new kname[MAX_PLAYER_NAME];   //killername
	GetPlayerName(killerid, kname, sizeof(kname));
	format(pstring, sizeof(pstring), "~r~:( you got 0wned by %s",kname);
	GameTextForPlayer(playerid, pstring, 4000, 3);
	
	new kscore=GetPlayerScore(killerid);
	SetPlayerScore(killerid,kscore++);
	PlayerInfo[playerid][Deaths]++;
	PlayerInfo[killerid][Kills]++;
	new moneytemp;
	moneytemp = GetPlayerMoney(playerid)/8;
	if(moneytemp<=5000) {
		GivePlayerMoney(killerid,moneytemp);
		GivePlayerMoney(playerid,-moneytemp);
	}
	else if(moneytemp>5000) {
		GivePlayerMoney(killerid,5000);
		GivePlayerMoney(playerid,-5000);
	
	}
	SendClientMessageToAll(COLOR_GREEN, string);
	return 1;
}



Re: GameForPlayer after killed - tyler12 - 26.06.2012

GameTextForPlayer


Re: GameForPlayer after killed - kbalor - 26.06.2012

Quote:
Originally Posted by God'Z War
Посмотреть сообщение
Try This
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	new msg[128],reasonMsg[32], pname[MAX_PLAYER_NAME], string[128], deathreason[20];
	SendDeathMessage(killerid,playerid,reason);
	GameTextForPlayer(playerid,"~r~~h~OWNED",10000,1);
	GetPlayerName(playerid, pname, sizeof(pname));
	GetWeaponName(reason, deathreason, 20);
	new pstring[128]; //player message
	new killer[MAX_PLAYER_NAME];
	GetPlayerName(killerid, killer, sizeof(killer));
 	PlayerInfo[ playerid ][ Deaths ] ++; //THIS IS THE ERROR
	new kstring[128]; //killer message
	GetPlayerName(playerid, pname, sizeof(pname));
	format(kstring, sizeof(kstring), "~b~Haha Ya 0wned %s",pname);
	GameTextForPlayer(killerid, kstring, 4000, 3);
	new kname[MAX_PLAYER_NAME];   //killername
	GetPlayerName(killerid, kname, sizeof(kname));
	format(pstring, sizeof(pstring), "~r~:( you got 0wned by %s",kname);
	GameTextForPlayer(playerid, pstring, 4000, 3);
	
	new kscore=GetPlayerScore(killerid);
	SetPlayerScore(killerid,kscore++);
	PlayerInfo[playerid][Deaths]++;
	PlayerInfo[killerid][Kills]++;
	new moneytemp;
	moneytemp = GetPlayerMoney(playerid)/8;
	if(moneytemp<=5000) {
		GivePlayerMoney(killerid,moneytemp);
		GivePlayerMoney(playerid,-moneytemp);
	}
	else if(moneytemp>5000) {
		GivePlayerMoney(killerid,5000);
		GivePlayerMoney(playerid,-5000);
	
	}
	SendClientMessageToAll(COLOR_GREEN, string);
	return 1;
}
i got this errors

(7775) : error 017: undefined symbol "PlayerInfo"
(7775) : warning 215: expression has no effect
(7775) : error 001: expected token: ";", but found "]"
(7775) : error 029: invalid expression, assumed zero
(7775) : fatal error 107: too many error messages on one line


Re: GameForPlayer after killed - Dan_Barocu - 26.06.2012

error line?


Re: GameForPlayer after killed - tyler12 - 26.06.2012

replace that with your current OnPlayerDeath


Re: GameForPlayer after killed - Skaizo - 26.06.2012

very simple
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    GameTextForPlayer(playerid," You got killed by %s", killerid);
    return 1;
}



Re: GameForPlayer after killed - kbalor - 26.06.2012

Quote:
Originally Posted by Skaizo
Посмотреть сообщение
very simple
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    GameTextForPlayer(playerid," You got killed by %s", killerid);
    return 1;
}
if i killed him/er??


Re: GameForPlayer after killed - God'Z War - 26.06.2012

Quote:
Originally Posted by kbalor
Посмотреть сообщение
i got this errors

(7775) : error 017: undefined symbol "PlayerInfo"
(7775) : warning 215: expression has no effect
(7775) : error 001: expected token: ";", but found "]"
(7775) : error 029: invalid expression, assumed zero
(7775) : fatal error 107: too many error messages on one line
Kablor add this
Код:
new PlayerInfo[MAX_PLAYERS][pInfo];



Re: GameForPlayer after killed - kbalor - 26.06.2012

Quote:
Originally Posted by God'Z War
Посмотреть сообщение
Kablor add this
Код:
new PlayerInfo[MAX_PLAYERS][pInfo];
It gives more error

PHP код:
(45) : error 017undefined symbol "pInfo"
(45) : error 009invalid array size (negativezero or out of bounds)
(
7778) : error 017undefined symbol "Deaths"
(7790) : error 017undefined symbol "Deaths"
(7791) : error 017undefined symbol "Kills"
(7770) : warning 204symbol is assigned a value that is never used"reasonMsg"
(7770) : warning 204symbol is assigned a value that is never used"msg"