04.09.2015, 22:10
Okay, so i have made a bullet shell system and blood system both work to what i want but if you shot multiple times and hit a player with a SMG for example multiple shell/blood drops but it only allows you to pickup one of the blood/shell fort example? here is the processShell if you want the onplayertakedamage i can.
Код:
Function ProcessShell(playerid)
{
for(new i = 1; i < MAX_SHELLS; i++)
{
if(ShellInfo[i][sId] == 0)
{
sShells++;
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
new GunName[25];
new GunID = GetPlayerWeapon(playerid);
GetWeaponName(GunID, GunName, sizeof(GunName));
new text[256],Float:PosXx,Float:PosYy,Float:PosZz;
GetPlayerPos(playerid, PosXx, PosYy, PosZz);
ShellInfo[i][sPos][0] = PosXx;
ShellInfo[i][sPos][1] = PosYy;
ShellInfo[i][sPos][2] = PosZz-0.9;
ShellInfo[i][sBy] = name;
format(text,sizeof(text),"Bullet Shell [%s]", GunName);
ShellInfo[i][sText] = CreateDynamic3DTextLabel(text, -1,ShellInfo[i][sPos][0],ShellInfo[i][sPos][1],ShellInfo[i][sPos][2],5.0);
return 1;
}
}
return 1;
}
Код:
CMD:pickupshell(playerid,params[])
{
if (GetPlayerState(playerid) != PLAYER_STATE_ONFOOT || !IsPlayerSpawned(playerid))
return SendErrorMessage(playerid, "You can't use this command right now.");
if (GetFactionType(playerid) != FACTION_POLICE)
return SendErrorMessage(playerid, "You're not authorized to use this command.");
if (!PlayerData[playerid][pOnDuty])
return SendErrorMessage(playerid, "You can't use this command while off duty!");
new string[128];
if(IsPlayerInAnyVehicle(playerid)) return SendErrorMessage(playerid, "You can't do that in a vehicle.");
if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) return SendErrorMessage(playerid, "You need to crouch to pick the bullet shell.");
new shell = IsPlayerNearShell(playerid,9.0);
if(IsPlayerNearShell(playerid,9.0))
{
format(string, sizeof(string), "* %s gets down on their knees, putting their latex gloves on - placing the bullet case in a small bag.", ReturnName(playerid, 0));
SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "%s", string);
SendServerMessage(playerid,"You'll have to return back to evidence room to get more information '/confirmshell'");
CarryShell(playerid, shell);
return 1;
}
else
{
SendErrorMessage(playerid,"You're not near any gun shells.");
return 1;
}
}

