Jump to content

تصحيح كود .


Recommended Posts

السلام عليكم ورحمة الله وبركاتة

شباب انا مسوي سكربت وأظن فيه لخبطة كثييييييييييير أرجو منكم مساعدتي وتقولوا لي وش الخطا عشان أفهم

Client:

addEventHandler('onClientGUIClick',root, 
function Spawn () 
local grid = guiCreateGridList ( 306,161,199,309, true )  
local columnA = guiGridListAddColumn ( grid, "Title", 0.85 )  
rowA = guiGridListAddRow ( grid ) 
rowB = guiGridListAddRow ( grid ) 
guiGridListSetItemText ( myGridList, rowA, columnA, "Spawn", false, false )      
guiGridListSetItemText ( myGridList, rowB, columnA, "Spawn2", false, false ) 
local SpawnName = guiGridListGetItemText ( grid, guiGridListGetSelectedItem ( grid ), 1 ) 
setElementData ( Player, "Spawncite", SpawnName ) 
end ) 
addEventHandler("onClientResourceStart", Spawn) 

Server:

function Spawncite ( ) 
    setElementData ( source, "Spawncite", getTickCount() ) 
    players = getElementsByType ( "player" ) 
for playerKey, playerValue in ipairs(players) do 
    spawnPlayer ( playerValue, 0.0, 0.0, 5.0, 90.0, 0 ) 
end 
end 
addEventHandler ( "onPlayerWasted", getRootElement(), Spawncite ) 

وشكراً لكم

Link to comment

function Spawn () 
local grid = guiCreateGridList ( 306,161,199,309, false ) 
local columnA = guiGridListAddColumn ( grid, "Title", 0.85 ) 
rowA = guiGridListAddRow ( grid ) 
rowB = guiGridListAddRow ( grid ) 
guiGridListSetItemText ( grid, rowA, columnA, "Spawn", false, false )     
guiGridListSetItemText ( grid, rowB, columnA, "Spawn2", false, false ) 
local SpawnName = guiGridListGetItemText ( grid, guiGridListGetSelectedItem ( grid ), 1 ) 
setElementData ( localPlayer, "Spawncite", SpawnName ) 
end 
addEventHandler("onClientResourceStart", root, Spawn) 

function Spawncite ( ) 
setElementData ( source, "Spawncite", getTickCount() ) 
local players = getElementsByType ( "player" ) 
for playerKey, playerValue in ipairs(players) do 
spawnPlayer ( playerValue, 0.0, 0.0, 5.0, 90.0, 0 ) 
end 
end 
addEventHandler ( "onPlayerWasted", root, Spawncite ) 
Edited by Guest
Link to comment
function Spawn () 
local grid = guiCreateGridList ( 306,161,199,309, true ) 
local columnA = guiGridListAddColumn ( grid, "Title", 0.85 ) 
rowA = guiGridListAddRow ( grid ) 
rowB = guiGridListAddRow ( grid ) 
guiGridListSetItemText ( myGridList, rowA, columnA, "Spawn", false, false )     
guiGridListSetItemText ( myGridList, rowB, columnA, "Spawn2", false, false ) 
local SpawnName = guiGridListGetItemText ( grid, guiGridListGetSelectedItem ( grid ), 1 ) 
setElementData ( localPlayer, "Spawncite", SpawnName ) 
end 
addEventHandler("onClientResourceStart", root, Spawn) 

function Spawncite ( ) 
setElementData ( source, "Spawncite", getTickCount() ) 
local players = getElementsByType ( "player" ) 
for playerKey, playerValue in ipairs(players) do 
spawnPlayer ( playerValue, 0.0, 0.0, 5.0, 90.0, 0 ) 
end 
end 
addEventHandler ( "onPlayerWasted", root, Spawncite ) 

أخوي ليش الجريد ليست مايظهر ؟

Link to comment

function Spawn () 
local grid = guiCreateGridList ( 306,161,199,309, false ) 
local columnA = guiGridListAddColumn ( grid, "Title", 0.85 ) 
rowA = guiGridListAddRow ( grid ) 
rowB = guiGridListAddRow ( grid ) 
guiGridListSetItemText ( grid, rowA, columnA, "Spawn", false, false )     
guiGridListSetItemText ( grid, rowB, columnA, "Spawn2", false, false ) 
local SpawnName = guiGridListGetItemText ( grid, guiGridListGetSelectedItem ( grid ), 1 ) 
setElementData ( localPlayer, "Spawncite", SpawnName ) 
end 
addEventHandler("onClientResourceStart", root, Spawn) 

function Spawncite ( ) 
setElementData ( source, "Spawncite", getTickCount() ) 
local players = getElementsByType ( "player" ) 
for playerKey, playerValue in ipairs(players) do 
spawnPlayer ( playerValue, 0.0, 0.0, 5.0, 90.0, 0 ) 
end 
end 
addEventHandler ( "onPlayerWasted", root, Spawncite ) 
Link to comment

جرب كذا طيب

Button = guiCreateButton(319,477,173,53,"",false) 
  
function Spawn () 
grid = guiCreateGridList ( 306,161,199,309, false ) 
local columnA = guiGridListAddColumn ( grid, "Title", 0.85 ) 
rowA = guiGridListAddRow ( grid ) 
rowB = guiGridListAddRow ( grid ) 
guiGridListSetItemText ( grid, rowA, columnA, "Spawn", false, false )     
guiGridListSetItemText ( grid, rowB, columnA, "Spawn2", false, false ) 
local SpawnName = guiGridListGetItemText ( grid, guiGridListGetSelectedItem ( grid ), 1 ) 
setElementData ( localPlayer, "Spawncite", SpawnName ) 
end 
addEventHandler("onClientResourceStart", resourceRoot, Spawn) 
  
addEventHandler ("onClientGUIClick", resourceRoot,  
  function () 
    if (source == Button) then 
       local row, col = guiGridListGetSelectedItem (grid) 
       local text = guiGridListGetItemText (grid, row, col) 
       if (text and text ~= "") then 
          setElementData (localPlayer, "Spawncite", text) 
        end 
    end 
end 
) 
Edited by Guest
Link to comment
تقدر تسويها كذا

if getElementData (source, "Spawncite") == "Spawn" then 
spawnPlayer (x,y,z) 
elseif getElementData (source, "Spawncite") == "Spawn2" then 
spawnPlayer (x,y,z) 
end 

او انك تسوي جدول, فهذي اسهل لك

function Spawncite ( ) 
if getElementData (source, "Spawncite") == "Spawn" then 
spawnPlayer (source, 0.0, 0.0, 5.0, 90.0, 0) 
elseif getElementData (source, "Spawncite") == "Spawn2" then 
spawnPlayer (source, 0.0, 0.0, 5.0, 90.0, 0) 
end 
end 
addEventHandler ("onPlayerWasted", root, Spawncite) 

بجربه وبعطيك خبر وعلي كل حال شكراً لك ياخوي ماقصرت والله :|

Link to comment

أخوي معلش تعتبك معي

أنا الحين سويت الزر كيف أربطه بالجريد ليست يعني لما تختار شئ من الجريد ليست وتضغط علي الزر الحدث يحصل

Button = guiCreateButton(319,477,173,53,"",false) 
function Spawn () 
local grid = guiCreateGridList ( 306,161,199,309, false ) 
local columnA = guiGridListAddColumn ( grid, "Title", 0.85 ) 
rowA = guiGridListAddRow ( grid ) 
rowB = guiGridListAddRow ( grid ) 
guiGridListSetItemText ( grid, rowA, columnA, "Spawn", false, false )     
guiGridListSetItemText ( grid, rowB, columnA, "Spawn2", false, false ) 
local SpawnName = guiGridListGetItemText ( grid, guiGridListGetSelectedItem ( grid ), 1 ) 
setElementData ( localPlayer, "Spawncite", SpawnName ) 
end 
addEventHandler("onClientResourceStart", root, Spawn) 

function Spawncite ( ) 
if getElementData (source, "Spawncite") == "Spawn" then 
spawnPlayer (source, 1846.18262, 845.95850, 9.71960) 
elseif getElementData (source, "Spawncite") == "Spawn2" then 
spawnPlayer (source, 0.0, 0.0, 5.0, 90.0, 0) 
end 
end 
addEventHandler ("onPlayerWasted", root, Spawncite) 

Link to comment
Button = guiCreateButton(319,477,173,53,"",false) 
  
addEventHandler ("onClientGUIClick", resourceRoot, 
function () 
  if (source == Button) then 
function Spawn () 
local grid = guiCreateGridList ( 306,161,199,309, false ) 
local columnA = guiGridListAddColumn ( grid, "Title", 0.85 ) 
rowA = guiGridListAddRow ( grid ) 
rowB = guiGridListAddRow ( grid ) 
guiGridListSetItemText ( grid, rowA, columnA, "Spawn", false, false )     
guiGridListSetItemText ( grid, rowB, columnA, "Spawn2", false, false ) 
local SpawnName = guiGridListGetItemText ( grid, guiGridListGetSelectedItem ( grid ), 1 ) 
setElementData ( localPlayer, "Spawncite", SpawnName ) 
end 
  
   end 
end 
) 
  
addEventHandler("onClientResourceStart", root, Spawn) 

كذا صح ؟

Link to comment

Button = guiCreateButton(319,477,173,53,"",false) 
  
function Spawn () 
local grid = guiCreateGridList ( 306,161,199,309, false ) 
local columnA = guiGridListAddColumn ( grid, "Title", 0.85 ) 
rowA = guiGridListAddRow ( grid ) 
rowB = guiGridListAddRow ( grid ) 
guiGridListSetItemText ( grid, rowA, columnA, "Spawn", false, false )     
guiGridListSetItemText ( grid, rowB, columnA, "Spawn2", false, false ) 
local SpawnName = guiGridListGetItemText ( grid, guiGridListGetSelectedItem ( grid ), 1 ) 
setElementData ( localPlayer, "Spawncite", SpawnName ) 
end 
addEventHandler("onClientResourceStart", resourceRoot, Spawn) 
  
addEventHandler ("onClientGUIClick", resourceRoot,  
  function () 
    if (source == Button) then 
       local row, col = guiGridListGetSelectedItem (grid) 
       local text = guiGridListGetItemText (grid, row, col) 
       if (text and text ~= "") then 
          setElementData (localPlayer, "Spawncite", text) 
        end 
    end 
end 
) 
Link to comment
Button = guiCreateButton(319,477,173,53,"",false) 
  
function Spawn () 
local grid = guiCreateGridList ( 306,161,199,309, false ) 
local columnA = guiGridListAddColumn ( grid, "Title", 0.85 ) 
rowA = guiGridListAddRow ( grid ) 
rowB = guiGridListAddRow ( grid ) 
guiGridListSetItemText ( grid, rowA, columnA, "Spawn", false, false )     
guiGridListSetItemText ( grid, rowB, columnA, "Spawn2", false, false ) 
local SpawnName = guiGridListGetItemText ( grid, guiGridListGetSelectedItem ( grid ), 1 ) 
setElementData ( localPlayer, "Spawncite", SpawnName ) 
end 
addEventHandler("onClientResourceStart", resourceRoot, Spawn) 
  
addEventHandler ("onClientGUIClick", resourceRoot,  
  function () 
    if (source == Button) then 
       local row, col = guiGridListGetSelectedItem (grid) 
       local text = guiGridListGetItemText (grid, row, col) 
       if (text and text ~= "") then 
          setElementData (localPlayer, "Spawncite", text) 
        end 
    end 
end 
) 

كلير إخترت Spwn وإنتحرت

ليش مارحت المكان اللي إخترته

للعلم أنا مشغل الـ play هل عليه تأثير؟

Link to comment

طيب جرب كذا

Button = guiCreateButton(319,477,173,53,"",false) 
  
function Spawn () 
grid = guiCreateGridList ( 306,161,199,309, false ) 
local columnA = guiGridListAddColumn ( grid, "Title", 0.85 ) 
rowA = guiGridListAddRow ( grid ) 
rowB = guiGridListAddRow ( grid ) 
guiGridListSetItemText ( grid, rowA, columnA, "Spawn", false, false )     
guiGridListSetItemText ( grid, rowB, columnA, "Spawn2", false, false ) 
local SpawnName = guiGridListGetItemText ( grid, guiGridListGetSelectedItem ( grid ), 1 ) 
setElementData ( localPlayer, "Spawncite", SpawnName ) 
end 
addEventHandler("onClientResourceStart", resourceRoot, Spawn) 
  
addEventHandler ("onClientGUIClick", resourceRoot,  
  function () 
    if (source == Button) then 
       local row, col = guiGridListGetSelectedItem (grid) 
       local text = guiGridListGetItemText (grid, row, col) 
       if (text and text ~= "") then 
          setElementData (localPlayer, "Spawncite", text) 
        end 
    end 
end 
) 
Link to comment
طيب جرب كذا

Button = guiCreateButton(319,477,173,53,"",false) 
  
function Spawn () 
grid = guiCreateGridList ( 306,161,199,309, false ) 
local columnA = guiGridListAddColumn ( grid, "Title", 0.85 ) 
rowA = guiGridListAddRow ( grid ) 
rowB = guiGridListAddRow ( grid ) 
guiGridListSetItemText ( grid, rowA, columnA, "Spawn", false, false )     
guiGridListSetItemText ( grid, rowB, columnA, "Spawn2", false, false ) 
local SpawnName = guiGridListGetItemText ( grid, guiGridListGetSelectedItem ( grid ), 1 ) 
setElementData ( localPlayer, "Spawncite", SpawnName ) 
end 
addEventHandler("onClientResourceStart", resourceRoot, Spawn) 
  
addEventHandler ("onClientGUIClick", resourceRoot,  
  function () 
    if (source == Button) then 
       local row, col = guiGridListGetSelectedItem (grid) 
       local text = guiGridListGetItemText (grid, row, col) 
       if (text and text ~= "") then 
          setElementData (localPlayer, "Spawncite", text) 
        end 
    end 
end 
) 

أخوي تمام ضبط والله وشكراً لك ، أسف تعتبك معي كثييييييييييييييييييييييييييير

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...