Jump to content

Walid

Members
  • Posts

    1,491
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Walid

  1. this how you can fix it -- Server side local Table = { "word1", "word2" } function showits(player) if isElement(player) then triggerClientEvent(player,"showit",player,getWordsTable()) end end addCommandHandler("showit",showits) addCommandHandler ( "addword", function ( player, cmd, word ) if word then table.insert ( Table, tostring ( word ) ) end end ) function randomizer() word = Table[math.random(#Table)] outputChatBox("Random word "..word.."") end addCommandHandler("words",randomizer) addCommandHandler ( "removeword", function ( player, cmd, word ) if word then for k, v in pairs ( Table ) do if v == word then table.remove ( Table, k ) break end end end end ) function getWordsTable() return Table end -- Client side addEventHandler("onClientResourceStart",resourceRoot, function() window1 = guiCreateWindow(471, 219, 200, 210, "Words in randomizer", false) guiWindowSetSizable(window1, false) guiSetVisible(window1,false) gridlist1 = guiCreateGridList(16, 50, 167, 146, false, window1) collumn1 = guiGridListAddColumn(gridlist1, "Words", 0.9) end ) function addWordToGridList(Table) guiSetVisible(window1,true) for i, v in pairs (Table) do local row = guiGridListAddRow(gridlist1) guiGridListSetItemText (gridlist1, row, collumn1,tostring(v[1]),false, false) end end addEvent("showit",true) addEventHandler("showit",root,addWordToGridList)
  2. lol are you serious you want to use "guiGridListSetItemText" server side your code is wrong.
  3. هكذا local team = getPlayerTeam(element) if team then if getTeamName(team == " الإسم") then -- your code here end end
  4. Example addEventHandler("onClientResourceStart",resourceRoot, function() window1 = guiCreateWindow(471, 219, 200, 210, "Words in randomizer", false) guiWindowSetSizable(window1, false) guiSetVisible(window1,false) gridlist1 = guiCreateGridList(16, 50, 167, 146, false, window1) collumn1 = guiGridListAddColumn(gridlist1, "Words", 0.9) end ) function addWordToGridList() for i, v in pairs (Table) do local row = guiGridListAddRow(gridlist1) guiGridListSetItemText (gridlist1, row, collumn1,tostring(v[1]),false, false) end end
  5. you need to use something like that for i, v in pairs (Table) do -- you code here end
  6. أنا ما فهت عليك أنت تحب يكون فيه 2 group try to use or local marker1 = createMarker (-2416.55371,-603.77325,131.56250, "cylinder", 2, 244 , 87, 10, 255 ) addEventHandler ( "onMarkerHit", marker1, function (element,matchingDimension) if (matchingDimension and isElement(element) and getElementType ( element ) == "player") then local group = getElementData( element ,'Group') if (group == "max") or (group == "الثاني") then setElementHealth ( element, 100 ) setPedArmor ( element, 100 ) setElementModel ( element, 230 ) else outputChatBox ( "(max)يجب ان تكون بي عصابة",element, 244 , 87, 10, true ) end end end )
  7. Walid

    destroyElement

    really i don't undrestad nothing anyways to destroy somthing you need to use destroyElement if isElement(--[[ element here]]) then destroyElement(--[[ element here]]) end
  8. bindKey (source,"u","down", "chatbox","local")
  9. simply all what you need to do is reinstall your MTA:SA then use CCleaner. it should work
  10. it must be "onClientResourceStart" because you are trying to use (client;server) in the same code. here client side event and here server side event
  11. what do you mean by this
  12. You need to add the element here
  13. onClientPlayerWasted there is no ammo argument. function rewardOnWasted (killer, weapon, bodypart ) if (killer and isElement(killer) and getElementType(killer) == "player" and killer ~= source ) then if bodypart == 9 then triggerServerEvent("addUserEXP", resourceRoot, killer, 10) else triggerServerEvent("addUserEXP", resourceRoot, killer, 5) end end end addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), rewardOnWasted )
  14. according to this and this z is always 0 it mean 0+0.3 = 0.3
  15. the code is already server side and you are trying to use TriggerServerEvent. ??? Try to use "onClientPlayerWasted"
  16. lol as i can see it's enabled true.
  17. simply it can be like this function toggleGodMode(_,cur) local accountName = getAccountName(cur) if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then if getElementData(source,"invincible") then setElementData(source,"invincible",false) outputChatBox("GOD if off",source,0,255,0) else setElementData(source,"invincible",true) outputChatBox("GOD is on",source,0,255,0) end end end addEventHandler("onPlayerLogin",getRootElement(),toggleGodMode)
  18. Walid

    destroyElement

    can you explane your problem better
  19. try this untested -- Sever side function returnMail(result, player) if result == true then outputChatBox("You mail has been successfully sended !", player, 255, 255, 255, true) else outputChatBox("Sorry, there is a problem in your website", player, 255, 255, 255, true) end end addEvent("sendEMail", true) addEventHandler("sendEMail", getRootElement(), function(player, target, subject, msg) callRemote ( --[[ you website here ]], returnMail, player, target, subject, msg ) end) -- Php <?php include( "mta_sdk.php" ); $input = mta::getInput(); $player = $input[0]; $target = $input[1]; $subject = $input[2]; $message = $input[3]; $mail = $target; if (!preg_match("#^[a-z0-9._-]+@(hotmail|live|msn).[a-z]{2,4}$#", $mail)) { $passage_ligne = "\r\n"; } else { $passage_ligne = "\n"; } $message_txt = " "; $message_html = "Test".$message.""; $boundary = "-----=".md5(rand()); $sujet = "MTA - ".$subject.""; $header = "From: \"MTA\"<[email protected]>".$passage_ligne; $header.= "Reply-to: \"MTA\" <[email protected]>".$passage_ligne; $header.= "MIME-Version: 1.0".$passage_ligne; $header.= "Content-Type: multipart/alternative;".$passage_ligne." boundary=\"$boundary\"".$passage_ligne; $message = $passage_ligne."--".$boundary.$passage_ligne; $message.= $passage_ligne."--".$boundary.$passage_ligne; $message.= "Content-Type: text/html; charset=\"ISO-8859-1\"".$passage_ligne; $message.= "Content-Transfer-Encoding: 8bit".$passage_ligne; $message.= $passage_ligne.$message_html.$passage_ligne; $message.= $passage_ligne."--".$boundary."--".$passage_ligne; $message.= $passage_ligne."--".$boundary."--".$passage_ligne; mail($mail,$sujet,$message,$header); $theresult = true; mta::doReturn($theresult, $player); ?>
  20. You need to add the php file into your website.
×
×
  • Create New...