04.06.2012, 19:32
pawn Код:
stock DropWeapons(gunID,gunAmmo,Float:X,Float:Y,Float:Z,world,playerid)
{
if(IsADisabledWeapon(playerid,gunID))
{
return 1;
}
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
if(gunID != 0 && gunAmmo != 0)
{
for(new i = 0; i < sizeof(DropInfo); i++)
{
if(DropInfo[i][dx] == 0.0 && DropInfo[i][dy] == 0.0 && DropInfo[i][dz] == 0.0)
{
DropInfo[i][dType] = 1;
DropInfo[i][dAmount][0] = gunID;
DropInfo[i][dAmount][1] = gunAmmo;
DropInfo[i][dx] = X;
DropInfo[i][dy] = Y;
DropInfo[i][dz] = Z;
DropInfo[i][dWorld] = world;
strcpy(DropInfo[i][dPlayerName],name,MAX_PLAYER_NAME);
DropObject[i] = CreateDynamicObject(gh_GetObjectID(gunID), X, Y, Z-1, 80.0, 0.0, 0.0, world);
return 1;
}
}
return 1;
}
return 1;
}
pawn Код:
enum dInfo
{
dType,
dAmount[2],
Float:dx,
Float:dy,
Float:dz,
dWorld,
dPlayerName[MAX_PLAYER_NAME],
};
new DropInfo[500][dInfo];