30.09.2014, 04:22
hey the title says it all.
i want to know how can i store who was playerid killer into a variable so i can use it. As in the attempt above ^.
Actually this is a prototype of what i am trying to create right below
pawn Код:
if(dSpree[playerid] == 1)
{
killerid = pKiller;
revenge[playerid] = true;
SendClientMessage(playerid, COLOR_HOTORANGE, "You have died enough. Use /revenge to kill your last killer.");
}
Actually this is a prototype of what i am trying to create right below
pawn Код:
CMD:revenge(playerid, params[])
{
new playaname[2][MAX_PLAYER_NAME];
if(!IsPlayerConnected(pKiller)) return SendClientMessage(playerid, COLOR_RED, "Your victim is not connected.");
if(revenge[playerid] == false) return SendClientMessage(playerid, COLOR_RED, "You haven't died enough to have your revenge.");
else
{
new Float:x, Float:y, Float:z;
new Float:a, Float:b, Float:c;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(pKiller, x+10, y+10, z);
GetPlayerPos(pKiller, a, b, c);
CreateExplosion(a, b, c, 1, 9.0);
GetPlayerName(playerid, playaname[0], MAX_PLAYER_NAME);
GetPlayerName(pKiller, playaname[1], MAX_PLAYER_NAME);
format(szMessage, sizeof(szMessage), "[%d]%s has unleashed his dying spree and eliminated [%d]%s satisfying their lust for blood.", playerid, playaname[1], pKiller, playaname[1]);
SendClientMessageToAll(COLOR_HOTORANGE, szMessage);
revenge[playerid] = false;
dSpree[playerid] = 0;
}
return 1;
}