AhmadRS
Members-
Posts
11 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
AhmadRS's Achievements
Square (6/54)
1
Reputation
-
وش ممكن احط بدل السيريال؟ اخوي مشكور بس في خطأ بالسطر 81
-
Hello guys So I created this mod which saves whatever the player writes in this window. The message is supposed to be sent to all players and be saved in the database, which I was able to do successfully. But unfortunately, the mod sends and saves whatever the player writes only for those who are online. For example: I sent a message while me and my friend are online, It's saved and appears for both of us even if the mod was restarted. But if another player joins, he won't be able to see what I sent. The window: Client Side -- client side local screenW, screenH = guiGetScreenSize() wnd = guiCreateWindow((screenW - 557) / 2, (screenH - 340) / 2, 557, 340, "Test window", false)-- window guiWindowSetSizable(wnd, false) guiSetVisible(wnd,false) grd = guiCreateGridList(9, 28, 538, 170, false, wnd) colmn1 = guiGridListAddColumn(grd, "Message", 0.5)-- colmn for messages colmn2 = guiGridListAddColumn(grd, "Playername", 0.5)-- colmn for player name editb = guiCreateEdit(31, 208, 491, 42, "", false, wnd)-- editbox inbtn = guiCreateButton(143, 270, 271, 60, "Insert", false, wnd)-- insert button guiSetProperty(inbtn, "NormalTextColour", "FF00FF0C") bindKey("F6","down", function () if ( guiGetVisible(wnd) == false ) then guiSetVisible(wnd,true) showCursor(true) else guiSetVisible(wnd,false) showCursor(false) end end) addEventHandler("onClientGUIClick",inbtn, function () local TextInEditBox = guiGetText(editb) if ( guiEditGetCaretIndex( editb ) > 36 ) then outputChatBox( "#FF0000* #FF8000Testo System #FF0000: #FFFFFF It's a very long name.. what do you think", 255, 255, 255, true ) return end if ( TextInEditBox == '') then outputChatBox( "#FF0000* #FF8000Testo System #FF0000: #FFFFFF Huh?", 255, 255, 255, true ) return end if ( guiEditGetCaretIndex( editb ) < 7 ) then outputChatBox( "#FF0000* #FF8000Testo System #FF0000: #FFFFFF Are you sure that's a song name?", 255, 255, 255, true ) return end triggerServerEvent("TheTextWrittenInEditBox",localPlayer, TextInEditBox )-- send the message to server side end ) addEvent("AddToTheGridForAllPlayers",true) addEventHandler("AddToTheGridForAllPlayers",root, function ( TextInEditBox, playerName ) row = guiGridListAddRow ( grd ) guiGridListSetItemText ( grd, row, colmn1, TextInEditBox , false, false ) guiGridListSetItemText ( grd, row, colmn2, playerName , false, false ) triggerServerEvent("InsertIntoDataBase",localPlayer, TextInEditBox, playerName ) end ) addEvent("ReturnDataFromBaseToWindow",true) addEventHandler("ReturnDataFromBaseToWindow",root, function ( SavedText, SavedPlayerName ) row = guiGridListAddRow ( grd ) guiGridListSetItemText ( grd, row, colmn1, SavedText , false, false ) guiGridListSetItemText ( grd, row, colmn2, SavedPlayerName , false, false ) end ) triggerServerEvent("GetTheDataFromBase",localPlayer ) Server side -- server side local database = executeSQLQuery("CREATE TABLE IF NOT EXISTS MessageSaver3 (serial, text, playername)") addEvent("TheTextWrittenInEditBox",true) addEventHandler("TheTextWrittenInEditBox",root, function ( TextInEditBox ) local playerName = getPlayerName(source) triggerClientEvent(root,"AddToTheGridForAllPlayers",source, TextInEditBox, playerName )-- send it back with the same message and player name end ) addEvent("InsertIntoDataBase",true) addEventHandler("InsertIntoDataBase",root, function ( TextInEditBox, playerName ) if (#database == 0 ) then executeSQLQuery("INSERT INTO MessageSaver3(serial, text, playername) VALUES(?, ?, ?)", getPlayerSerial(source), TextInEditBox, playerName ) end end ) addEvent("GetTheDataFromBase",true) addEventHandler("GetTheDataFromBase",root, function ( ) local selectt = executeSQLQuery("SELECT * FROM MessageSaver3 WHERE serial=?", getPlayerSerial(source) ) if (#selectt ~= 0) then for _,v in ipairs (selectt) do local SavedText = v.text local SavedPlayerName = v.playername triggerClientEvent(source,"ReturnDataFromBaseToWindow",source, SavedText, SavedPlayerName )-- send the data to gridlist end end end ) I want it to save whatever any player writes
-
السلام عليكم ورحمة الله وبركاته .. شباب انا كنت ابغى اسوي مود يرسل رسائل لكل اللاعبين .. والرسالة المفروض تظهر لكل اللاعبين وتنحفظ بقاعدة بيانات بحيث لو رسترت السيرفر او المود الرسايل تفضل موجودة. الحمدلله عرفت اسوي الفكرة هذه بس واجهتني مشكلة وهي ان لو انا وخويي بنفس السيرفر , وارسلت رسالة باللوحة الرسالة بتظهر لي وله وبتنحفظ بقاعدة البيانات ومابتختفي نهائياً . بس لو انا كنت لحالي بالسيرفر وارسلت رسالة , بتنحفظ عندي تمام بس مابتظهر لأي لاعب بيدخل السيرفر بعدين. وهذه صورة للوحة client side --client side local screenW, screenH = guiGetScreenSize() wnd = guiCreateWindow((screenW - 557) / 2, (screenH - 340) / 2, 557, 340, "Test window", false)-- window guiWindowSetSizable(wnd, false) guiSetVisible(wnd,false) grd = guiCreateGridList(9, 28, 538, 170, false, wnd) colmn1 = guiGridListAddColumn(grd, "Message", 0.5)-- colmn for messages colmn2 = guiGridListAddColumn(grd, "Playername", 0.5)-- colmn for player name editb = guiCreateEdit(31, 208, 491, 42, "", false, wnd)-- editbox inbtn = guiCreateButton(143, 270, 271, 60, "Insert", false, wnd)-- insert button guiSetProperty(inbtn, "NormalTextColour", "FF00FF0C") bindKey("F6","down", function () if ( guiGetVisible(wnd) == false ) then guiSetVisible(wnd,true) showCursor(true) else guiSetVisible(wnd,false) showCursor(false) end end) addEventHandler("onClientGUIClick",inbtn, function () local TextInEditBox = guiGetText(editb) if ( guiEditGetCaretIndex( editb ) > 36 ) then outputChatBox( "#FF0000* #FF8000Testo System #FF0000: #FFFFFF It's a very long name.. what do you think", 255, 255, 255, true ) return end if ( TextInEditBox == '') then outputChatBox( "#FF0000* #FF8000Testo System #FF0000: #FFFFFF Huh?", 255, 255, 255, true ) return end if ( guiEditGetCaretIndex( editb ) < 7 ) then outputChatBox( "#FF0000* #FF8000Testo System #FF0000: #FFFFFF Are you sure that's a song name?", 255, 255, 255, true ) return end triggerServerEvent("TheTextWrittenInEditBox",localPlayer, TextInEditBox )-- send the message to server side end ) addEvent("AddToTheGridForAllPlayers",true) addEventHandler("AddToTheGridForAllPlayers",root, function ( TextInEditBox, playerName ) row = guiGridListAddRow ( grd ) guiGridListSetItemText ( grd, row, colmn1, TextInEditBox , false, false ) guiGridListSetItemText ( grd, row, colmn2, playerName , false, false ) triggerServerEvent("InsertIntoDataBase",localPlayer, TextInEditBox, playerName ) end ) addEvent("ReturnDataFromBaseToWindow",true) addEventHandler("ReturnDataFromBaseToWindow",root, function ( SavedText, SavedPlayerName ) row = guiGridListAddRow ( grd ) guiGridListSetItemText ( grd, row, colmn1, SavedText , false, false ) guiGridListSetItemText ( grd, row, colmn2, SavedPlayerName , false, false ) end ) triggerServerEvent("GetTheDataFromBase",localPlayer ) server side -- server side local database = executeSQLQuery("CREATE TABLE IF NOT EXISTS MessageSaver3 (serial, text, playername)") addEvent("TheTextWrittenInEditBox",true) addEventHandler("TheTextWrittenInEditBox",root, function ( TextInEditBox ) local playerName = getPlayerName(source) triggerClientEvent(root,"AddToTheGridForAllPlayers",source, TextInEditBox, playerName )-- send it back with the same message and player name end ) addEvent("InsertIntoDataBase",true) addEventHandler("InsertIntoDataBase",root, function ( TextInEditBox, playerName ) if (#database == 0 ) then executeSQLQuery("INSERT INTO MessageSaver3(serial, text, playername) VALUES(?, ?, ?)", getPlayerSerial(source), TextInEditBox, playerName ) end end ) addEvent("GetTheDataFromBase",true) addEventHandler("GetTheDataFromBase",root, function ( ) local selectt = executeSQLQuery("SELECT * FROM MessageSaver3 WHERE serial=?", getPlayerSerial(source) ) if (#selectt ~= 0) then for _,v in ipairs (selectt) do local SavedText = v.text local SavedPlayerName = v.playername triggerClientEvent(source,"ReturnDataFromBaseToWindow",source, SavedText, SavedPlayerName )-- send the data to gridlist end end end )
-
سلام عليكم , كنت عايز كود يخلي في فترة بين كل ضغطة زر... يعني ماينفع يسوي سبام على زر معين ويطلعله رسالة بالشات انه لازم ينتظر 3 ثواني مثلا شكرا
-
Well, it worked.. but how can i get the right shader? Omg !! I found it. Thank you soooooooooooo muchhhhhhhhhhhhhhh
-
Hello there.. I need to install a paint into a modified vehicle.. Like this one Of course I know how to install a paintjob to a default GTA Vehicle. But i want to install the paintjob to the above vehicle.. Help a brother out
-
Well, thank you for the amazing explanation.. I think that shooting missiles is not possible using peds because i have tried your code and it did not work for ped, but i replaced the ped with the local player and it worked. Also , i have tried another controls like acceleration and it worked for ped. While vehicle_fire did not work. Anyway , thank you so much for helping me to realize that.
-
yep , i fixed the 3rd argument.. but it doesn't work as well. Besides, setPedControlState(ped, "vehicle_fire", true) only works for the player, not for ped.. That's what i have read on the wiki
-
I have just tried it.. Nope
-
No bro I want the ped to shoot from the the hunter (missiles). Not from his own weapon
-
I tried to do it but it doesn't shoot local hunter = createVehicle(425,x,y,z) local ped = createPed(0,x,y,z) warpPedIntoVehicle(ped, hunter) setPedAnalogControlState(ped, "Vehicle_fire")