Rat32 Posted February 28, 2015 Posted February 28, 2015 Hello. I have a problem. This script give me a weapon, ok - but he doesn't check a money, please help. CLIENT: function glock19a() triggerServerEvent("glock19e", resourceRoot) end addEventHandler("onClientGUIClick", p2, glock19a, false) SERVER: addEvent("glock19e", true) function glock19() outputChatBox(money) local money = getPlayerMoney(client) if money <= 2 then giveWeapon( client, 22, 1, true) outputChatBox(money) else outputChatBox(money) end end addEventHandler("glock19e", getRootElement(), glock19)
darhal Posted February 28, 2015 Posted February 28, 2015 LINE NUMBER ON/OFF | EXPAND/CONTRACT | SELECT ALL addEvent("glock19e", true)function glock19()outputChatBox(money)local money = getPlayerMoney(client)if money >=2 then giveWeapon( client, 22, 1, true)outputChatBox(money)elseoutputChatBox(money) endendaddEventHandler("glock19e", getRootElement(), glock19) #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
Addlibs Posted February 28, 2015 Posted February 28, 2015 addEvent("glock19e", true) function glock19() outputChatBox(money) local money = getPlayerMoney(client) if money >=2 then giveWeapon( client, 22, 1, true) outputChatBox(money) else outputChatBox(money) end end addEventHandler("glock19e", getRootElement(), glock19) Ps. Use proper thread title next time. Previously known as MrTasty.
Rat32 Posted February 28, 2015 Author Posted February 28, 2015 Thanks . I have next problem! function wejscie(client, thePlayer) local playerTeam = getPlayerTeam(thePlayer) local r,g,b = getTeamColor(playerTeam) triggerClientEvent(root, "nwejscie", client) if (getElementType(thePlayer) == "player") then setRadarAreaFlashing ( area, true ) timer = setTimer(function(thePlayer) setRadarAreaColor ( area, r, g, b, 175 ) end, 15000, 1) end end addEventHandler("onColShapeHit", areacol, wejscie) This code triggered to all players, but i i want trigger to source. How?
darhal Posted February 28, 2015 Posted February 28, 2015 triggerClientEvent(thePlayer, "nwejscie", thePlayer) #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
darhal Posted February 28, 2015 Posted February 28, 2015 Show tje hole code #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
Rat32 Posted February 28, 2015 Author Posted February 28, 2015 area = createRadarArea ( 2150.32666, -1393.43091, 45.61223, -40, 0, 0, 0, 175 ) areacol = createColRectangle (2177.8818, -1391.3579, 73.828125, 84.75, 114.5, 2) area2 = createRadarArea ( 2058.73267, -1211.01526, 23.98452, -40, 0, 0, 0, 175) area2col = createColRectangle (2082.4915, -1206.2887, 86.5, 95, 114.5, 2) setRadarAreaSize ( area, 100, 100 ) setRadarAreaSize ( area2, 100, 100 ) function wejscie(client, thePlayer) local playerTeam = getPlayerTeam(thePlayer) local r,g,b = getTeamColor(playerTeam) triggerClientEvent(thePlayer, "nwejscie", thePlayer) if (getElementType(thePlayer) == "player") then setRadarAreaFlashing ( area, true ) timer = setTimer(function(thePlayer) setRadarAreaColor ( area, r, g, b, 175 ) end, 15000, 1) end end addEventHandler("onColShapeHit", areacol, wejscie) function wyjscie(thePlayer) if (getElementType(thePlayer) == "player") then setRadarAreaFlashing ( area, false ) killTimer (timer) end end addEventHandler("onColShapeLeave", areacol, wyjscie)
darhal Posted February 28, 2015 Posted February 28, 2015 Delete client at line 9 #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
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