02.04.2014, 18:49
Quote:
I cant see return 1; under OnPlayerWeaponShot.
Its a callback brother, Must return a value. |
at the end of all of that.
pawn Код:
public OnPlayerWeaponShot( playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ )
{
if( hittype == BULLET_HIT_TYPE_OBJECT )
{
if( hitid == Minigun || hitid == 2985 )
{
MinigunHealth--;
new string[112], kname[MAX_PLAYER_NAME];
GetPlayerName(playerid, kname, sizeof(kname));
format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~r~MINIGUN DAMAGED~n~HP: ~r~%d~h~~h~/~r~100", MinigunHealth);
GameTextForPlayer(playerid, string, 1000, 3);
if(MinigunHealth == 35)
{
foreach(Player, i)
{
new stringg[112];
format(stringg, sizeof(stringg), "* %s[%d] has damaged the minigun to %d/100 health!", kname, playerid, MinigunHealth);
SendClientMessage(i, COLOR_RED, stringg);
SendClientMessage(i, COLOR_RED, "* The Minigun has enabled its Advanced Self-Defense mode!");
MinigunDamage = 20;
MinigunRange = 55;
}
}
else if(MinigunHealth == 1)
{
format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~r~MINIGUN DESTROYED\nHP: ~w~%d~r~/~r~100", MinigunHealth);
GameTextForPlayer(playerid, string, 1500, 3);
foreach(Player, i)
{
new name[MAX_PLAYER_NAME];
if(SpawnedBy{ i })
{
GetPlayerName(i, name, sizeof(name));
new stringgg[112];
format(stringgg, sizeof(stringgg), "* %s[%d] destroyed [%d]%s's minigun!", name, playerid, i, name);
SendClientMessageToAll(COLOR_SWAG, stringgg);
SetPlayerHealth(playerid, 99);
GivePlayerScore(playerid, 3);
GivePlayerCash(playerid, 15000);
SendClientMessage(playerid, COLOR_SWAG, "* You've received 3 score and 15'000$!");
CanControlMG{ i } = false;
SpawnedBy{ i } = false;
}
}
Minigun = DestroyObject(Minigun);
Miniguns = 0;
foreach(Player, i)
{
KillTimer(MTimer[i]);
}
}
}
else if( hitid == 3052 || hitid == C4OBject )
{
foreach(Player, i)
{
if(IsPlayerInRangeOfPoint(i, 15, C4Pos[0], C4Pos[1], C4Pos[2]))
{
if(!SKProtection{ i })
{
OnPlayerDeath(i, playerid, 39);
SpawnPlayer(i);
GameTextForPlayer(i, "~r~You got C4'd!", 3500, 3);
}
}
else if(IsPlayerInRangeOfPoint(i, 25, C4Pos[0], C4Pos[1], C4Pos[2]))
{
if(!SKProtection{ i })
{
SetPlayerHealth(i, 36);
SendClientMessage(i, COLOR_RED, "* You got damaged from the C4 blast!");
}
}
if(PlayerUsedBomb{ i })
{
DestroyObject(C4Object[i]);
PlayerUsedBomb{ i } = false;
Delete3DTextLabel(C4[i]);
}
}
CreateExplosion(C4Pos[0], C4Pos[1]+1, C4Pos[2], 2, 100);
CreateExplosion(C4Pos[0], C4Pos[1]+1, C4Pos[2], 3, 100);
CreateExplosion(C4Pos[0], C4Pos[1]+1, C4Pos[2], 4, 100);
//Delete3DTextLabel(C4[playerid]);
}
}
return 1;
}