[HELP] hitman system please -
Luca12 - 31.05.2014
Hello I was make when some player contract the other player then that contract is go to hitman's and then leader of hitman types /portable and in dialog he go to see available targets and then he hire some hitman to kill that target and that's is the problem when hitman kill the target then it should be send text to other hitman's that hitman some name kill target some name and he is collect the prize of 2000$. Thanks
Re: [HELP] hitman system please -
Rittik - 31.05.2014
Under OnPlayerDeath. This might help you out.
Код:
if(PlayerInfo[killerid][Hitman]==1)
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if(PlayerInfo[i][Hitman]==1)
{
new str[128],name1[128],name2[128];;
GetPlayerName(playerid,name2,sizeof(name2));
GetPlayerName(killerid,name1,sizeof(name1));
format(str,sizeof(str),"Hitman %s has killed his target %s",name1,name2);
SendClientMessage(i,-1,str);
}
}
}
Re: [HELP] hitman system please -
Eth - 31.05.2014
@rittik stop copying and paste please.
and luca search for one.
Re: [HELP] hitman system please -
Rittik - 31.05.2014
Copying and pasting ? who's code did I copied ?
Re: [HELP] hitman system please -
Luca12 - 31.05.2014
Quote:
Originally Posted by Eth
@rittik stop copying and paste please.
and luca search for one.
|
I was searching here but I didn't find only if I poste my code then I hope so someone will find the problem? Thanks
Re: [HELP] hitman system please -
Eth - 31.05.2014
Quote:
Originally Posted by Rittik
Copying and pasting ? who's code did I copied ?
|
did you even define or told him the "playerinfo" enum? you just gave him your hitman system that's all
@luca12:
https://sampforum.blast.hk/showthread.php?tid=479454
Re: [HELP] hitman system please -
Luca12 - 31.05.2014
that's not what I need I have my code everything working exepct when hitman kill the target but the problem is that's then nothing happening there's no message to hitman that is target dead and hitman doens't get money
Re: [HELP] hitman system please -
Eth - 31.05.2014
Then first of all, do a ver called new Hmoney[MAX_PLAYERS]; and new Hit[MAX_PLAYERS];
now in the hit command : set the Hmoney[theid] to the money of the requested money and set hit[theid] to : hit[theid] = 1
now onplayerdeath
pawn Код:
if(hit[playerid] == 1)
{
hit[playerid] = 0
GivePlayerMoney(killerid,Hmoney[playerid]);
new string[200];
format(string,sizeof(string),"%s killed %s and got the money of the bounty:%d",killerid,playerid,Hmoney[playerid]);
SendClientMessageToAll(-1,string);
Hmoney[playerid] = 0;}
Re: [HELP] hitman system please -
Luca12 - 31.05.2014
why this code won't work
pawn Код:
if(Target[killerid] == playerid) here target var is set to the hitman in givehit who's get to kill target
{
new nejm[2][MAX_PLAYER_NAME],string[128];
RPName(playerid,nejm[0]);
RPName(killerid,nejm[1]);
format(string,128,"Hitman %s is kill %s and collect %d$.",nejm[1],nejm[0],PlayerInfo[playerid][Contract]);
FamilyMessage(11,COLOR_ZUTA,string);
format(string,128,"|Hitman| %s is kill: %s",nejm[1],nejm[0]);
AdminMessage(BLUE,string);
MoneyPlus(killerid,PlayerInfo[playerid][Contract]);
PlayerInfo[playerid][Contract] = 0;
Target[killerid] = -1;
new query[128];
mysql_format(mysql,query,sizeof(query),"UPDATE `users` SET `Contract` = %d WHERE `ID` = '%s'",PlayerInfo[playerid][Contract],PlayerInfo[playerid][ID]);
mysql_tquery(mysql,query,"""");
}