05.04.2014, 00:12
Olб pessoal, bom eu e meu amigo estavamos testando o GM para o nosso servidor, e quando fomos testar o headshot ele deu o problema o seguinte problema: mesmo a pessoa estando de esc, ele mata o player do mesmo jeito.
Aqui estб o code:
Se alguem puder ajudar eu e meu amigo agradecemos muito.
Aqui estб o code:
Код:
stock HeadshotCheck(playerid, &Float:x, &Float:y, &Float:z) { new Float:fx,Float:fy,Float:fz; GetPlayerCameraFrontVector(playerid, fx, fy, fz); new Float:cx,Float:cy,Float:cz; GetPlayerCameraPos(playerid, cx, cy, cz); for(new Float(idea) = 0.0; i < 50; i = i + 0.5) { x = fx * i + cx; y = fy * i + cy; z = fz * i + cz; #if defined SHOWPATH CreatePickup(1239, 4, x, y, z, -1); #endif for(new player = 0; player < SERVER_MAX_PLAYERS; player ++) { if(IsPlayerConnected(playerid)) { if(player != playerid) { if(GetPlayerSpecialAction(player) == SPECIAL_ACTION_DUCK) { if(IsValidWeaponForHeadShot(playerid)) { if(IsPlayerInRangeOfPoint(player, 0.3, x, y, z)) { GameTextForPlayer(playerid, "~r~HEADSHOT!", 7000, 5); GameTextForPlayer(player, "~r~HEADSHOT!", 7000, 5); SetPlayerHealth(player, 0.0); CallRemoteFunction("OnPlayerDeath", "ddd", player, playerid, GetPlayerWeapon(playerid)); } } } else { if(IsValidWeaponForHeadShot(playerid)) { if(IsValidWeaponForHeadShot(playerid)) { if(IsPlayerInRangeOfPoint(player, 0.3, x, y, z - 0.7)) { GameTextForPlayer(playerid, "~r~HEADSHOT!", 7000, 5); GameTextForPlayer(player, "~r~HEADSHOT!", 7000, 5); SetPlayerHealth(player, 0.0); CallRemoteFunction("OnPlayerDeath", "ddd", player, playerid, GetPlayerWeapon(playerid)); } } } } } } } } return 1; }