2 players aiming on adm=no weapon - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: 2 players aiming on adm=no weapon (
/showthread.php?tid=533274)
2 players aiming on adm=no weapon -
SonicFreeStyle - 23.08.2014
Hey guys,i'm trying to make a sistem but i don't know how,i wanna make 2 things,first,if some player aim at a adm (in work) the weapon change to 0 (fist) (adm working line: admtrampando[playerid] = 1; )
and if 2 players aim at one,this one will make the handsup animation automatic,how can make this sistem for me? is fast to do but i don't know what to use :/
Re: 2 players aiming on adm=no weapon -
Thogy - 23.08.2014
pawn Код:
public OnPlayerUpdate(playerid)
{
new p = GetPlayerTargetPlayer(playerid);
if(p == INVALID_PLAYER_ID)
{
}
else
{
//First thing you want
if(admtrampando[playerid] == 1)
{
GivePlayerWeapon(playerid, 0, 1);
}
//Second thing you want
SetPlayerSpecialAction(p, SPECIAL_ACTION_HANDSUP);
}
return 1;
}
Re: 2 players aiming on adm=no weapon -
SonicFreeStyle - 23.08.2014
ok thanks but the second thing i want only if 2 players aim,this code will make only 2 player aim and set the action :P
Re: 2 players aiming on adm=no weapon -
Thogy - 24.08.2014
I am not sure, what u want. This causes, that when player1 aim player2 and player2 aim player1, player2 will hands up.
pawn Код:
public OnPlayerUpdate(playerid)
{
new p = GetPlayerTargetPlayer(playerid);
if(p != INVALID_PLAYER_ID)
{
//First thing you want
if(admtrampando[playerid] == 1)
{
GivePlayerWeapon(playerid, 0, 1);
}
//Second thing you want
if(GetPlayerTargetPlayer(p) == playerid)
{
SetPlayerSpecialAction(p, SPECIAL_ACTION_HANDSUP);
}
}
return 1;
}