Question about saving a playerid
#1

Is there a way to save a player (for example killerid from "OnPlayerDeath") and use it in other callback (for example in "OnPlayerCommandText") without using sscanf?
Reply
#2

//EDIT: fixed something...im always too fast when writing stuff :P

you could do this:
pawn Код:
//global
new someID;

//somewhere in OnPlayerDeath
someID = killerid;

//somewhere in OnPlayerCommandText
//do your thing with "someID" as killerid of OnPlayerDeath here
you could also trigger OnPlayerCommandText by doing
pawn Код:
OnPlayerCommandText(killerid,"_");
//and then parse cmdtext of OnPlayerCommandText at the top for "_"
but i'd rather not suggest doing it like that.
decide 4 yourself
Reply
#3

Thank you, but because you made an array variable, it must be indexed, so i think it would be ok without [MAX_PLAYERS] (global variable)...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)