charaf12 Posted January 29, 2014 Share Posted January 29, 2014 السلام عليكم شباب الي يقدر يساعدني ابي كود يوم تضرب السارق بالعصى يتبعك وابي كود الي عندو 5 نجوم سجن 5 دقائق و 3 نجوم 3 دقائق و كذا Link to comment
al-Kobra Posted January 29, 2014 Share Posted January 29, 2014 الاعتقال : 'onPlayerDamage' getPlayerWantedLevel getPlayerTeam > getTeamName setControlState toggleAllControls setElementData getElementData getElementPosition getDistanceBetweenPoints3D getElementRotation setTimer > setElementRotation سجن اللاعب : getPlayerWantedLevel setTimer > setElementPosition Link to comment
Mando Posted January 29, 2014 Share Posted January 29, 2014 -- Server Side # local Timer = {} local marker = createMarker(...) addEventHandler('onPlayerDamage',root,function(attacker) if attacker and attacker ~= source and getElementType(attacker) == 'player' and getPlayerTeam(attacker) and getTeamName(getPlayerTeam(attacker)) == 'Police' then if getPlayerWantedLevel(source) > 0 and getPlayerTeam(source) and getTeamName(getPlayerTeam(source)) ~= 'Police' then if isTimer(Timer[source]) then killTimer(Timer[source]) Timer[source] = nil end toggleAllControls(source,false,false,false) toggleControl(source,'forwards',true) setControlState(source,'forwards',true) Timer[source] = setTimer(function() local rx,ry,rz,ax,ay,az,px,py,pz = getElementRotation(attacker),getElementPosition(attacker),getElementPosition(source) setElementRotation(source,rx,ry,rz) if getDistanceBetweenPoints3D(ax,ay,az,px,py,pz) <= 5 then toggleControl(source,'forwards',false) else toggleControl(source,'forwards',true) setControlState(source,'forwards',true) end end,50,0,source) end end end ) addEventHandler('onMarkerHit',marker,function(plr) if getElementType(plr) == 'player' then toggleAllControls(plr,true,true,true) end end ) الحقوق : The Best Link to comment
charaf12 Posted January 29, 2014 Author Share Posted January 29, 2014 (edited) مشكور اخي بس تبع اش الكود ذا واذا يجب اضافة اشاء اليه اشرح لاهنت edit: الكود غير شغال ارجو الافادة Edited January 31, 2014 by Guest Link to comment
RoMaNd! Posted January 30, 2014 Share Posted January 30, 2014 الكود غير شغال ارجو الافادة local Timer = {} -- الوقت local marker = createMarker ( الاحداثيات, 1.0, "ring", 1, 255, 255, 0, 0 ); addEventHandler('onPlayerDamage',root,function(attacker) if attacker and attacker ~= source and getElementType(attacker) == 'player' and getPlayerTeam(attacker) and getTeamName(getPlayerTeam(attacker)) == 'Police' then if getPlayerWantedLevel(source) > 0 and getPlayerTeam(source) and getTeamName(getPlayerTeam(source)) ~= 'Police' then if isTimer(Timer[source]) then killTimer(Timer[source]) Timer[source] = nil end toggleAllControls(source,false,false,false) toggleControl(source,'forwards',true) setControlState(source,'forwards',true) Timer[source] = setTimer(function() local rx,ry,rz,ax,ay,az,px,py,pz = getElementRotation(attacker),getElementPosition(attacker),getElementPosition(source) setElementRotation(source,rx,ry,rz) if getDistanceBetweenPoints3D(ax,ay,az,px,py,pz) <= 5 then toggleControl(source,'forwards',false) else toggleControl(source,'forwards',true) setControlState(source,'forwards',true) end end,50,0,source) end end end ) addEventHandler('onMarkerHit',marker,function(plr) if getElementType(plr) == 'player' then toggleAllControls(plr,true,true,true) end end Link to comment
al-Kobra Posted January 30, 2014 Share Posted January 30, 2014 جرب, -- Server Side # local Timer = {} local marker = createMarker(...) addEventHandler('onPlayerDamage',root,function(attacker) if attacker and attacker ~= source and getElementType(attacker) == 'player' and getPlayerTeam(attacker) and getTeamName(getPlayerTeam(attacker)) == 'Police' then if getPlayerWantedLevel(source) > 0 and getPlayerTeam(source) and getTeamName(getPlayerTeam(source)) ~= 'Police' then if isTimer(Timer[source]) then killTimer(Timer[source]) Timer[source] = nil end if not getElementData(source,'getPlayerFromData') then setElementData(source,'getPlayerFromData',source) end toggleAllControls(source,false,true,false) toggleControl(source,'forwards',true) setControlState(source,'forwards',true) Timer[source] = setTimer(function() local rx,ry,rz,ax,ay,az,px,py,pz = getElementRotation(attacker),getElementPosition(attacker),getElementPosition(source) setElementRotation(source,rx,ry,rz) if getDistanceBetweenPoints3D(ax,ay,az,px,py,pz) <= 5 then toggleControl(source,'forwards',false) else toggleControl(source,'forwards',true) setControlState(source,'forwards',true) end end,50,0,source) end end end ) addEventHandler('onMarkerHit',marker,function(plr) if getElementType(plr) == 'player' and getElementData(plr,'getPlayerFromData') then toggleAllControls(getElementData(plr,'getPlayerFromData'),true,true,true) setElementPosition(getElementData(plr,'getPlayerFromData'),x,y,z) end end ) Link to comment
charaf12 Posted January 30, 2014 Author Share Posted January 30, 2014 احداثيات وش احط قصدك احداثيات الي يصلها الشرطي حتى ينفك الحرامي Link to comment
al-Kobra Posted January 30, 2014 Share Posted January 30, 2014 الكود غير شغال ارجو الافادة local Timer = {} -- الوقت local marker = createMarker ( الاحداثيات, 1.0, "ring", 1, 255, 255, 0, 0 ); addEventHandler('onPlayerDamage',root,function(attacker) if attacker and attacker ~= source and getElementType(attacker) == 'player' and getPlayerTeam(attacker) and getTeamName(getPlayerTeam(attacker)) == 'Police' then if getPlayerWantedLevel(source) > 0 and getPlayerTeam(source) and getTeamName(getPlayerTeam(source)) ~= 'Police' then if isTimer(Timer[source]) then killTimer(Timer[source]) Timer[source] = nil end toggleAllControls(source,false,false,false) toggleControl(source,'forwards',true) setControlState(source,'forwards',true) Timer[source] = setTimer(function() local rx,ry,rz,ax,ay,az,px,py,pz = getElementRotation(attacker),getElementPosition(attacker),getElementPosition(source) setElementRotation(source,rx,ry,rz) if getDistanceBetweenPoints3D(ax,ay,az,px,py,pz) <= 5 then toggleControl(source,'forwards',false) else toggleControl(source,'forwards',true) setControlState(source,'forwards',true) end end,50,0,source) end end end ) addEventHandler('onMarkerHit',marker,function(plr) if getElementType(plr) == 'player' then toggleAllControls(plr,true,true,true) end end 1.0 الا في بداية فنكشن الماركر من وين جايبها ؟ Link to comment
charaf12 Posted January 30, 2014 Author Share Posted January 30, 2014 ارجو شرح التعويضات وش احط في الاحداثيات يعني تبع اش هي و الوقت تبع اشرح لاهنتو اشرحو الكود Link to comment
Tete omar Posted January 31, 2014 Share Posted January 31, 2014 charaf12 لا تكرر المشاركات المزدوجة والمواضيع المشابهة لنفسها Link to comment
charaf12 Posted January 31, 2014 Author Share Posted January 31, 2014 اوك متاسف كتير لاهنتو اشرح لي الكود Link to comment
Do_De<3 Posted January 31, 2014 Share Posted January 31, 2014 اوك متاسف كتيرلاهنتو اشرح لي الكود الحين انت وش طالب تو ؟ مو تقول عطوني مود الاعتقال ؟ الحين تقول اشرحوهه لي؟ ههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههآ حشيش فآخر قدن قدن ض2 Link to comment
charaf12 Posted January 31, 2014 Author Share Posted January 31, 2014 انا فهم بس وش اعوض احداثيات وش Link to comment
فاّرس Posted January 31, 2014 Share Posted January 31, 2014 عدل بس سطر 2 حط ارقومنتات الماركر الي اذا لمسه اللاعب ينتقل للسجن, + افضل انك تسوي داتا لأنه بينقل الشرطي معه Link to comment
charaf12 Posted January 31, 2014 Author Share Posted January 31, 2014 ممكن تعدلي على الكود لاهنت Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now