|
CMD:rarma(playerid, params[]) { new f = MAX_OBJ+1; for(new a = 0; a < sizeof(PosObjeto); a++) { if(IsPlayerInRangeOfPoint(playerid, 5.0, PosObjeto[a][0], PosObjeto[a][1], PosObjeto[a][2])) { f = a; break; } } if(f > MAX_OBJ) return SendClientMessage(playerid, 0x33AA3300, "No estбs cerca de ningъn arma."); else { new NombreArma[25]; new string[150]; PosObjeto[f][0] = 0.0; PosObjeto[f][1] = 0.0; PosObjeto[f][2] = 0.0; DestroyObject(Objeto[f]); //GivePlayerWeapon(playerid, IDObjeto[f][0], IDObjeto[f][1]); DarArma(playerid, IDObjeto[f][0]); GetWeaponNameEx(IDObjeto[f][0], NombreArma, sizeof(NombreArma)); format(string, sizeof(string), "* %s recoge %s del suelo.", NombreJugador(playerid), NombreArma); ProxDetector(30.0, playerid, string, COLOR_ROL,COLOR_ROL,COLOR_ROL,COLOR_ROL,COLOR_ROL) ; } return 1; } |
CMD:rarma(playerid, params[])
{
if(PlayerCrouching(playerid) == 1) return SendClientMessage(playerid, -1, "nesesitas estar agachado para usar este comando");
new f = MAX_OBJ+1;
for(new a = 0; a < sizeof(PosObjeto); a++)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, PosObjeto[a][0], PosObjeto[a][1], PosObjeto[a][2]))
{
f = a;
break;
}
}
if(f > MAX_OBJ) return SendClientMessage(playerid, 0x33AA3300, "No estбs cerca de ningъn arma.");
else
{
new NombreArma[25];
new string[150];
PosObjeto[f][0] = 0.0;
PosObjeto[f][1] = 0.0;
PosObjeto[f][2] = 0.0;
DestroyObject(Objeto[f]);
//GivePlayerWeapon(playerid, IDObjeto[f][0], IDObjeto[f][1]);
DarArma(playerid, IDObjeto[f][0]);
GetWeaponNameEx(IDObjeto[f][0], NombreArma, sizeof(NombreArma));
format(string, sizeof(string), "* %s recoge %s del suelo.", NombreJugador(playerid), NombreArma);
ProxDetector(30.0, playerid, string, COLOR_ROL,COLOR_ROL,COLOR_ROL,COLOR_ROL,COLOR_ROL) ;
}
return 1;
}
PlayerCrouching(playerid)
{
new anim_lib[32];
new anim_name[32];
GetAnimationName(GetPlayerAnimationIndex(playerid), anim_lib, 32, anim_name, 32);
if(strcmp(anim_lib, "PED") == 0 && strcmp(anim_name, "WEAPON_CROUCH") == 0) return 1;
return 0;
}
|
Код:
CMD:rarma(playerid, params[])
{
if(PlayerCrouching(playerid) == 1) return SendClientMessage(playerid, -1, "nesesitas estar agachado para usar este comando");
new f = MAX_OBJ+1;
for(new a = 0; a < sizeof(PosObjeto); a++)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, PosObjeto[a][0], PosObjeto[a][1], PosObjeto[a][2]))
{
f = a;
break;
}
}
if(f > MAX_OBJ) return SendClientMessage(playerid, 0x33AA3300, "No estбs cerca de ningъn arma.");
else
{
new NombreArma[25];
new string[150];
PosObjeto[f][0] = 0.0;
PosObjeto[f][1] = 0.0;
PosObjeto[f][2] = 0.0;
DestroyObject(Objeto[f]);
//GivePlayerWeapon(playerid, IDObjeto[f][0], IDObjeto[f][1]);
DarArma(playerid, IDObjeto[f][0]);
GetWeaponNameEx(IDObjeto[f][0], NombreArma, sizeof(NombreArma));
format(string, sizeof(string), "* %s recoge %s del suelo.", NombreJugador(playerid), NombreArma);
ProxDetector(30.0, playerid, string, COLOR_ROL,COLOR_ROL,COLOR_ROL,COLOR_ROL,COLOR_ROL) ;
}
return 1;
}
PlayerCrouching(playerid)
{
new anim_lib[32];
new anim_name[32];
GetAnimationName(GetPlayerAnimationIndex(playerid), anim_lib, 32, anim_name, 32);
if(strcmp(anim_lib, "PED") == 0 && strcmp(anim_name, "WEAPON_CROUCH") == 0) return 1;
return 0;
}
|

if(GetPlayerAnimationIndex(playerid))
{
new animlib[32];
new animname[32];
new msg[128];
GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
format(msg, 128, "Running anim: %s %s", animlib, animname);
SendClientMessage(playerid, 0xFFFFFFFF, msg);
}
PlayerRun(playerid)
{
new anim_lib[32];
new anim_name[32];
GetAnimationName(GetPlayerAnimationIndex(playerid), anim_lib, 32, anim_name, 32);
if(strcmp(anim_lib, "PED") == 0 && strcmp(anim_name, "RUN_CIVI") == 0) return 1;
return 0;
}
public OnPlayerUpdate(playerid)
{
if(GetPlayerInterior(playerid) == 12 && PlayerRun(playerid) == 1)
{
ClearAnimations(playerid);
SendClientMessage(playerid, -1, "No corras en una casa.");
}
return 1;
}
PlayerRun(playerid)
{
new anim_lib[32];
new anim_name[32];
GetAnimationName(GetPlayerAnimationIndex(playerid), anim_lib, 32, anim_name, 32);
if(strcmp(anim_lib, "PED") == 0 && strcmp(anim_name, "RUN_CIVI") == 0) return 1;
return 0;
}
if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) return SendClientMessage(playerid, COLOR_GREY, "Usted debe estar agachado para poder recoger el arma del piso.");