Tematy otagowane jako: strefie
1. Niewidzialne blipy graczy na strefie DM
Witam ot?? chodzi mi o to, jak gracz wkroczy na teren dm nie wida? go na mapce kod:
KOD PO STRONIE KLIENTA
--[[
authors : nanKy , Malentas
resource : DM area
]]
local cuboiddm = createColCuboid (- 2901.64 , 496.91 , 4.91 , 305.25 , 257 , 15 )
local zone = createRadarArea (- 2901.64 , 496.91 , 320 , - 260 , 255 , 0 , 0 , 160 )
addEventHandler ( "onClientColShapeHit" , resourceRoot , function( player )
if player ~= localPlayer then return end
setElementData ( localPlayer , "strefadm" , true )
outputChatBox ( "Jestes w niebezpiecznej strefe! Uwazaj na siebie!" )
toggleControl ( "fire" , true )
toggleControl ( "aim_weapon" , true )
end )
addEventHandler ( "onClientColShapeLeave" , resourceRoot , function( player )
if player ~= localPlayer then return end
setElementData ( localPlayer , "strefadm" , false )
outputChatBox ( "Wychodzisz z niebezpiecznej strefy!" )
triggerServerEvent ( player , "zajebkarabinki" , localPlayer )
toggleControl ( "fire" , false )
toggleControl ( "aim_weapon" , false )
end )
addEventHandler ( "onClientPlayerWasted" , root , function( player )
if player ~= localPlayer then return end
if getElementData ( localPlayer , "strefadm" ) then
setElementPositon ( localPlayer , 2543.36 , 50.57 , 26.48 )
end
end )
2. [DM] Zabijanie w strefie
Mam pytanie jak mog? wykona? ?e gdy gracz jest w strefie ?mierci to mo?e zabija? wszystkimi pojazdami w gm mam kod ze jak gracz zabije innego w danym poje?dzie to go zamyka do wiezienia a jak zrobi? aby to nie dzia?a?o w strefie .
anty heli-kill
Kod:
if(!IsPlayerInAnyVehicle(playerid) && reason == 50)
{
LosKrata(killerid);
Player[killerid][InJail] = 120;
format(String, sizeof(String), "›› |jail| Gracz %s (%d) zosta? uwi?ziony przez ochroniarza WRT Team'u na 120s pow?d: heli-kill.", PlayerName2(killerid), killerid);
SendClientMessageToAll(COLOR_ORANGE, String);
return 1;
}
Strefa
Kod:
for( new o; o != sizeof FreeZone_Pos; o ++ )
{
if(IsPlayerInArea2(PlayerId, DMZone_Pos[ o ][ 0 ], DMZone_Pos[ o ][ 1 ], DMZone_Pos[ o ][ 2 ], DMZone_Pos[ o ][ 3 ]) == 1)
{
if(GetPlayerVirtualWorld(PlayerId) == 0)
{
TextDrawShowForPlayer(PlayerId, Strefa_DM);
}
}
}