OnDialogResponse killerid
#1

How can I get the killerid to OnDialogResponse ?
Reply
#2

What do you mean to the dialog?... on player death function you can make a dialog..
please explain better.
Reply
#3

Store it into an integer.

Below your includes add:

pawn Код:
new killeridstored;
;

Now under OnPlayerDeath add:

pawn Код:
killeridstored = killerid
;

Now you can use killeridstored.
Reply
#4

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.
Reply
#5

Quote:
Originally Posted by gtakillerIV
Посмотреть сообщение
Store it into an integer.

Below your includes add:

pawn Код:
new killeridstored;
;

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
Reply
#6

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, "....");
     }
Reply
#7

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
Reply
#8

Read Antonio's and my reply.
Reply
#9

Yea I know thanks
My post was replay to Dinam
was late I didn't see your replays
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)