if(isAlive[playerid] == false)
{
SetPlayerPos(playerid, Deadx[playerid], Deady[playerid], Deadz[playerid]);
SetPlayerInterior(playerid, deadint[playerid]);
SetPlayerVirtualWorld(playerid, deadvw[playerid]);
stopanimAllowed[playerid] = true;
SCM(playerid, COLOR_LIGHTRED, "You're currently brutally wounded. If no-one helps you, you will die. /acceptdeath if you wish to give up.");
TogglePlayerControllable(playerid,1);
SetTimerEx("LoadDeathAnim", 1000, false, "i", playerid);
SetPlayerSkin(playerid, oldskin[playerid]);
for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(i, playerid, true);
new string[400];
new holder[400];
SetPlayerArmedWeapon(playerid,0);
ResetPlayerWeapons(playerid);
To set player's active weapon to fist, use
PHP код:
PHP код:
|
public OnPlayerUpdate(playerid)
{
new iCurWeap = GetPlayerWeapon(playerid); // Return the player's current weapon
if(iCurWeap != GetPVarInt(playerid, "iCurrentWeapon")) // If he changed weapons since the last update
{
// Lets call a callback named OnPlayerChangeWeapon
OnPlayerChangeWeapon(playerid, GetPVarInt(playerid, "iCurrentWeapon"), iCurWeap);
SetPVarInt(playerid, "iCurrentWeapon", iCurWeap);//Update the weapon variable
SetPlayerArmedWeapon(playerid,0);
}
return 1; // Send this update to other players.
}
stock OnPlayerChangeWeapon(playerid, oldweapon, newweapon)
{
new s[128],
oWeapon[24],
nWeapon[24];
GetWeaponName(oldweapon, oWeapon, sizeof(oWeapon));
GetWeaponName(newweapon, nWeapon, sizeof(nWeapon));
format(s, sizeof(s), "You changed weapon from %s to %s!", oWeapon, nWeapon);
SendClientMessage(playerid, 0xFFFFFFFF, s);
}
Thanks, is there a way to lock them into the fists without the player losing their weapons tough?
|