OnDialogResponse killerid -
The.Game - 20.03.2013
How can I get the killerid to OnDialogResponse ?
Re: OnDialogResponse killerid -
PaulDinam - 20.03.2013
What do you mean to the dialog?... on player death function you can make a dialog..
please explain better.
Re: OnDialogResponse killerid -
gtakillerIV - 20.03.2013
Store it into an integer.
Below your includes add:
;
Now under OnPlayerDeath add:
pawn Код:
killeridstored = killerid
;
Now you can use killeridstored.
Re: OnDialogResponse killerid -
LarzI - 20.03.2013
By storing it in a global variable:
pawn Код:
new
g_iKillerID[ MAX_PLAYERS ]
;
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
g_iKillerID[ playerid ] = killerid;
//other stuff
return true;
}
You may then use g_iKillerID[ playerid ] to get the id of the killer of playerid.
Re: OnDialogResponse killerid -
[ABK]Antonio - 20.03.2013
Quote:
Originally Posted by gtakillerIV
Store it into an integer.
Below your includes add:
;
Now under OnPlayerDeath add:
pawn Код:
killeridstored = killerid
;
Now you can use killeridstored.
|
Not exactly, I mean, you can use that variable... However, someone might get another players killerid. That's where you would use an array with MAX_PLAYERS as the size.
pawn Код:
new LastKiller[MAX_PLAYERS];
then
pawn Код:
LastKiller[playerid]=killerid;
Of course, you would need to reset this on the players log out for example
EDIT: ah, was a little late :P
Re: OnDialogResponse killerid -
The.Game - 20.03.2013
I made anti team kill OnPlayerDeath
pawn Код:
if(gTeam[killerid] == gTeam[playerid])
Now the playerid will get a dialog to punish killerid
So how can I get killerid to OnDialogResponse
example
pawn Код:
case 0:// The first item listed
{
SendClientMessage(killerid, red, "....");
}
Re: OnDialogResponse killerid -
[ABK]Antonio - 20.03.2013
Quote:
Originally Posted by The.Game
I made anti team kill OnPlayerDeath
pawn Код:
if(gTeam[killerid] == gTeam[playerid])
Now the playerid will get a dialog to punish killerid
So how can I get killerid to OnDialogResponse
example
pawn Код:
case 0:// The first item listed { SendClientMessage(killerid, red, "...."); }
|
You could just use SetPlayerTeam... Anyway, you would do like both Larzi and I said. Inside of the dialog would be
pawn Код:
SendClientMessage(LastKiller[playerid], red, "....");
That's how you use it
Re: OnDialogResponse killerid -
LarzI - 20.03.2013
Read Antonio's and my reply.
Re: OnDialogResponse killerid -
The.Game - 20.03.2013
Yea I know thanks
My post was replay to Dinam
was late I didn't see your replays