PDA

View Full Version : Render player to press a key


SukMathcuck
29/03/2015, 08:11 PM
Resolvido!

Evocator
29/03/2015, 08:20 PM
As of what i understood, i came up with this:


public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
new
targetplayer = GetPlayerTargetPlayer(playerid)
;

if ( (oldkeys & KEY_JUMP) && (newkeys & KEY_HANDBRAKE) )
{
if (targetplayer != INVALID_PLAYER_ID)
{
new
otherplayer = INVALID_PLAYER_ID
;

for (new J = GetMaxPlayers(), i; i != J; i++)
{
if (!IsPlayerConnected(i)) continue;
if (GetPlayerState(i) != PLAYER_STATE_ONFOOT) continue;
if (GetPlayerTargetPlayer(i) == targetplayer)
{
otherplayer = i;
break;
}
}

if (otherplayer != INVALID_PLAYER_ID)
{
SendClientMessage(playerid, COLOR_BLACKRED, "<!> Rendered Player!");
SendClientMessage(otherplayer, COLOR_BLACKRED, "<!> Rendered Player!");
SetPlayerSpecialAction(targetplayer,SPECIAL_ACTION _HANDSUP);
}
else SendClientMessage(playerid, COLOR_BLACKRED, "You need two players aiming to render a victim");
}
}
return 1;
}

SukMathcuck
29/03/2015, 08:40 PM
Resolvido!