Hi com
Ich hab mir ma dropgun sys gemacht
und ein bug
ich krieg immer 1 Ammo bei jeder waffe
hoffe ihr könnt mir helfen
public OnPlayerDeath(playerid, killerid, reason)
{
SetTimer("Waffe",10000,true);
if(GetPlayerWeapon(playerid) == 24)
{
Deagle = GetPlayerAmmo(playerid);
GetPlayerPos(playerid,dX,dY,dZ);
Deagle = CreateObject(348, dX, dY, dZ-0.9, 110.0, 0.0, 00.0, 00.0);
}
if(GetPlayerWeapon(playerid) == 31)
{
M4 = GetPlayerAmmo(playerid);
GetPlayerPos(playerid,m4X,m4Y,m4Z);
M4 = CreateObject(356, m4X, m4Y, m4Z-0.9, 110.0, 0.0, 00.0, 00.0);
}
if(GetPlayerWeapon(playerid) == 29)
{
MP5 = GetPlayerAmmo(playerid);
GetPlayerPos(playerid,mpX,mpY,mpZ);
MP5 = CreateObject(353, mpX, mpY, mpZ-0.9, 110.0, 00.0, 00.0, 00.0);
}
if(GetPlayerWeapon(playerid) == 30)
{
Ak = GetPlayerAmmo(playerid);
GetPlayerPos(playerid,AkX,AkY,AkZ);
Ak = CreateObject(355 , AkX, AkY, AkZ-0.9, 110.0, 0.0, 00.0, 00.0);
}
return 1;
}
public Waffe(playerid)
{
if(IsPlayerInRangeOfPoint(playerid,1.0,mpX,mpY,mpZ))
{
GivePlayerWeapon(playerid,24,Deagle);
SetTimer("Deagle2",1200000,false);
DestroyObject(Deagle);
}
else
{
return 1;
}
if(IsPlayerInRangeOfPoint(playerid,1.0,mpX,mpY,mpZ))
{
GivePlayerWeapon(playerid,29,MP5);
SetTimer("MP52",1200000,false);
DestroyObject(MP5);
}
else
{
return 1;
}
if(IsPlayerInRangeOfPoint(playerid,1.0,AkX,AkY,AkZ))
{
GivePlayerWeapon(playerid,30,Ak);
SetTimer("Ak2",1200000,false);
DestroyObject(Ak);
}
else
{
return 1;
}
if(IsPlayerInRangeOfPoint(playerid,1.0,m4X,m4Y,m4Z))
{
GivePlayerWeapon(playerid,31,M4);
SetTimer("M42",1200000,false);
DestroyObject(M4);
}
else
{
return 1;
}
return 1;
}