-
Posts
1,248 -
Joined
-
Last visited
Everything posted by WhoAmI
-
I've found PHP array which contain all countries name and I converted it to LUA countriesName = { ["AF"] = "Afghanistan", ["AX"] = "Aland Islands", ["AL"] = "Albania", ["DZ"] = "Algeria", ["AS"] = "American Samoa", ["AD"] = "Andorra", ["AO"] = "Angola", ["AI"] = "Anguilla", ["AQ"] = "Antarctica", ["AG"] = "Antigua And Barbuda", ["AR"] = "Argentina", ["AM"] = "Armenia", ["AW"] = "Aruba", ["AU"] = "Australia", ["AT"] = "Austria", ["AZ"] = "Azerbaijan", ["BS"] = "Bahamas", ["BH"] = "Bahrain", ["BD"] = "Bangladesh", ["BB"] = "Barbados", ["BY"] = "Belarus", ["BE"] = "Belgium", ["BZ"] = "Belize", ["BJ"] = "Benin", ["BM"] = "Bermuda", ["BT"] = "Bhutan", ["BO"] = "Bolivia", ["BA"] = "Bosnia And Herzegovina", ["BW"] = "Botswana", ["BV"] = "Bouvet Island", ["BR"] = "Brazil", ["IO"] = "British Indian Ocean Territory", ["BN"] = "Brunei Darussalam", ["BG"] = "Bulgaria", ["BF"] = "Burkina Faso", ["BI"] = "Burundi", ["KH"] = "Cambodia", ["CM"] = "Cameroon", ["CA"] = "Canada", ["CV"] = "Cape Verde", ["KY"] = "Cayman Islands", ["CF"] = "Central African Republic", ["TD"] = "Chad", ["CL"] = "Chile", ["CN"] = "China", ["CX"] = "Christmas Island", ["CC"] = "Cocos (Keeling) Islands", ["CO"] = "Colombia", ["KM"] = "Comoros", ["CG"] = "Congo", ["CD"] = "Congo, Democratic Republic", ["CK"] = "Cook Islands", ["CR"] = "Costa Rica", ["CI"] = "Cote D'Ivoire", ["HR"] = "Croatia", ["CU"] = "Cuba", ["CY"] = "Cyprus", ["CZ"] = "Czech Republic", ["DK"] = "Denmark", ["DJ"] = "Djibouti", ["DM"] = "Dominica", ["DO"] = "Dominican Republic", ["EC"] = "Ecuador", ["EG"] = "Egypt", ["SV"] = "El Salvador", ["GQ"] = "Equatorial Guinea", ["ER"] = "Eritrea", ["EE"] = "Estonia", ["ET"] = "Ethiopia", ["FK"] = "Falkland Islands (Malvinas)", ["FO"] = "Faroe Islands", ["FJ"] = "Fiji", ["FI"] = "Finland", ["FR"] = "France", ["GF"] = "French Guiana", ["PF"] = "French Polynesia", ["TF"] = "French Southern Territories", ["GA"] = "Gabon", ["GM"] = "Gambia", ["GE"] = "Georgia", ["DE"] = "Germany", ["GH"] = "Ghana", ["GI"] = "Gibraltar", ["GR"] = "Greece", ["GL"] = "Greenland", ["GD"] = "Grenada", ["GP"] = "Guadeloupe", ["GU"] = "Guam", ["GT"] = "Guatemala", ["GG"] = "Guernsey", ["GN"] = "Guinea", ["GW"] = "Guinea-Bissau", ["GY"] = "Guyana", ["HT"] = "Haiti", ["HM"] = "Heard Island & Mcdonald Islands", ["VA"] = "Holy See (Vatican City State)", ["HN"] = "Honduras", ["HK"] = "Hong Kong", ["HU"] = "Hungary", ["IS"] = "Iceland", ["IN"] = "India", ["ID"] = "Indonesia", ["IR"] = "Iran, Islamic Republic Of", ["IQ"] = "Iraq", ["IE"] = "Ireland", ["IM"] = "Isle Of Man", ["IL"] = "Israel", ["IT"] = "Italy", ["JM"] = "Jamaica", ["JP"] = "Japan", ["JE"] = "Jersey", ["JO"] = "Jordan", ["KZ"] = "Kazakhstan", ["KE"] = "Kenya", ["KI"] = "Kiribati", ["KR"] = "Korea", ["KW"] = "Kuwait", ["KG"] = "Kyrgyzstan", ["LA"] = "Lao People's Democratic Republic", ["LV"] = "Latvia", ["LB"] = "Lebanon", ["LS"] = "Lesotho", ["LR"] = "Liberia", ["LY"] = "Libyan Arab Jamahiriya", ["LI"] = "Liechtenstein", ["LT"] = "Lithuania", ["LU"] = "Luxembourg", ["MO"] = "Macao", ["MK"] = "Macedonia", ["MG"] = "Madagascar", ["MW"] = "Malawi", ["MY"] = "Malaysia", ["MV"] = "Maldives", ["ML"] = "Mali", ["MT"] = "Malta", ["MH"] = "Marshall Islands", ["MQ"] = "Martinique", ["MR"] = "Mauritania", ["MU"] = "Mauritius", ["YT"] = "Mayotte", ["MX"] = "Mexico", ["FM"] = "Micronesia, Federated States Of", ["MD"] = "Moldova", ["MC"] = "Monaco", ["MN"] = "Mongolia", ["ME"] = "Montenegro", ["MS"] = "Montserrat", ["MA"] = "Morocco", ["MZ"] = "Mozambique", ["MM"] = "Myanmar", ["NA"] = "Namibia", ["NR"] = "Nauru", ["NP"] = "Nepal", ["NL"] = "Netherlands", ["AN"] = "Netherlands Antilles", ["NC"] = "New Caledonia", ["NZ"] = "New Zealand", ["NI"] = "Nicaragua", ["NE"] = "Niger", ["NG"] = "Nigeria", ["NU"] = "Niue", ["NF"] = "Norfolk Island", ["MP"] = "Northern Mariana Islands", ["NO"] = "Norway", ["OM"] = "Oman", ["PK"] = "Pakistan", ["PW"] = "Palau", ["PS"] = "Palestinian Territory, Occupied", ["PA"] = "Panama", ["PG"] = "Papua New Guinea", ["PY"] = "Paraguay", ["PE"] = "Peru", ["PH"] = "Philippines", ["PN"] = "Pitcairn", ["PL"] = "Poland", ["PT"] = "Portugal", ["PR"] = "Puerto Rico", ["QA"] = "Qatar", ["RE"] = "Reunion", ["RO"] = "Romania", ["RU"] = "Russian Federation", ["RW"] = "Rwanda", ["BL"] = "Saint Barthelemy", ["SH"] = "Saint Helena", ["KN"] = "Saint Kitts And Nevis", ["LC"] = "Saint Lucia", ["MF"] = "Saint Martin", ["PM"] = "Saint Pierre And Miquelon", ["VC"] = "Saint Vincent And Grenadines", ["WS"] = "Samoa", ["SM"] = "San Marino", ["ST"] = "Sao Tome And Principe", ["SA"] = "Saudi Arabia", ["SN"] = "Senegal", ["RS"] = "Serbia", ["SC"] = "Seychelles", ["SL"] = "Sierra Leone", ["SG"] = "Singapore", ["SK"] = "Slovakia", ["SI"] = "Slovenia", ["SB"] = "Solomon Islands", ["SO"] = "Somalia", ["ZA"] = "South Africa", ["GS"] = "South Georgia And Sandwich Isl.", ["ES"] = "Spain", ["LK"] = "Sri Lanka", ["SD"] = "Sudan", ["SR"] = "Suriname", ["SJ"] = "Svalbard And Jan Mayen", ["SZ"] = "Swaziland", ["SE"] = "Sweden", ["CH"] = "Switzerland", ["SY"] = "Syrian Arab Republic", ["TW"] = "Taiwan", ["TJ"] = "Tajikistan", ["TZ"] = "Tanzania", ["TH"] = "Thailand", ["TL"] = "Timor-Leste", ["TG"] = "Togo", ["TK"] = "Tokelau", ["TO"] = "Tonga", ["TT"] = "Trinidad And Tobago", ["TN"] = "Tunisia", ["TR"] = "Turkey", ["TM"] = "Turkmenistan", ["TC"] = "Turks And Caicos Islands", ["TV"] = "Tuvalu", ["UG"] = "Uganda", ["UA"] = "Ukraine", ["AE"] = "United Arab Emirates", ["GB"] = "United Kingdom", ["US"] = "United States", ["UM"] = "United States Outlying Islands", ["UY"] = "Uruguay", ["UZ"] = "Uzbekistan", ["VU"] = "Vanuatu", ["VE"] = "Venezuela", ["VN"] = "Viet Nam", ["VG"] = "Virgin Islands, British", ["VI"] = "Virgin Islands, U.S.", ["WF"] = "Wallis And Futuna", ["EH"] = "Western Sahara", ["YE"] = "Yemen", ["ZM"] = "Zambia", ["ZW"] = "Zimbabwe", }
-
You have to insert in table every country. Maybe there is some other faster way to do this, but that's only my way.
-
Does it happen only with this glue system?
-
Well, I don't think so if there is any other way. I mean, if you want other players to see what you've drawn they have to download that image.
-
You can also do like that countriesName = { ["DE"] = "Geremany", ["PL"] = "Poland", ["RU"] = "Russia", ... } addEventHandler ( "onPlayerJoin", root, function ( ) local countryShort = exports.admin:getPlayerCountry ( source ) local countryName = countriesName [ countryShort ] and countriesName [ countryShort ] or "Unknown"; if ( countryName ) then outputChatBox ( "* " .. getPlayerName ( source ) .. " has joined the game from " .. countryName, root, 255, 255, 255, true ); end end );
-
addEventHandler ("onPlayerJoin", root, function () local country = exports.admin:getPlayerCountry (source) outputChatBox ("Player entered from "..country) end)
-
He probably means that some vehicles are much higher than others, which can cause that text is inside vehicle.
-
What do you mean? Do you mean sth like that? local TimeTable = {} local waitTime = 3000 -- 3 seconds local infMarkers = { {2011.6, 1543.4, 10.5}, -- Marker 1 } for i , v in pairs (infMarkers) do createMarker ( v[1], v[2], v[3], "cylinder", 4, 255, 255, 0, 170 ) end function allowedVehicles( hitElement, matchingDimension ) if matchingDimension and isElement(hitElement) and getElementType(hitElement) == "player" then if isPedInVehicle ( hitElement ) then local vehicle = getPedOccupiedVehicle ( hitElement ) if vehicle then local model = getElementModel(vehicle) if tonumber(model) == 411 then if ( not isTimer ( TimeTable[hitElement] ) ) then setElementData ( hitElement, "entered.marker", true ) TimeTable[hitElement] = setTimer(GMinfernus, waitTime, 1, hitElement) end end end end end end addEventHandler( "onMarkerHit", resourceRoot, allowedVehicles ) addEventHandler ( "onMarkerLeave", resourceRoot, function ( leaveElement ) if ( isElement ( leaveElement ) and getElementType ( leaveElement ) == "player" ) then setElementData ( leaveElement, "entered.marker", false ) end end ) function GMinfernus (player) if isElement (player) then if getElementData ( player, "entered.marker" ) then givePlayerMoney(player, 5000) end end end
-
local TimeTable = {} local waitTime = 3000 -- 3 seconds local infMarkers = { {2011.6, 1543.4, 10.5}, -- Marker 1 } for i , v in pairs (infMarkers) do createMarker ( v[1], v[2], v[3], "cylinder", 4, 255, 255, 0, 170 ) end function allowedVehicles( hitElement, matchingDimension ) if matchingDimension and isElement(hitElement) and getElementType(hitElement) == "player" then if isPedInVehicle ( hitElement ) then local vehicle = getPedOccupiedVehicle ( hitElement ) if vehicle then local model = getElementModel(vehicle) if tonumber(model) == 411 then setElementData ( hitElement, "entered.marker", true ) TimeTable[hitElement] = setTimer(GMinfernus, waitTime, 1, hitElement) end end end end end addEventHandler( "onMarkerHit", resourceRoot, allowedVehicles ) addEventHandler ( "onMarkerLeave", resourceRoot, function ( leaveElement ) if ( isElement ( leaveElement ) and getElementType ( leaveElement ) == "player" ) then setElementData ( leaveElement, "entered.marker", false ) end end ) function GMinfernus (player) if isElement (player) then if getElementData ( player, "entered.marker" ) then givePlayerMoney(player, 5000) end end end
-
You've forgotten coma (',').
-
Line 91 server, there is a mistake. Should be triggerClientEvent
-
Yea, exactly, in this case you don't need to use s-side.
-
It is, because you are using gui's editbox while creating dxEditbox. Well, or only I am using it...
-
https://wiki.multitheftauto.com/wiki/OnElementDestroy
-
CTRL + C -> guiGetText -> setElementData CTRL + V -> getElementData -> guiSetText
-
function playerPressedKey ( button, press ) if ( button == "lctrl" ) then setElementData ( localPlayer, "lctrl", press and true or false ); end if ( button == "p" and press ) then local pressed = getElementData ( localPlayer, "lctrl" ); if ( pressed ) then -- ctrl + p combination was pressed end end end addEventHandler ( "onClientKey", root, playerPressedKey ); Maybe it is faster way to do that, but that's only my example.
-
You don't have to trigger it. If you use outputChatBox clientside it will be showed only to localPlayer. function Buy_1 () if getElementData(getLocalPlayer(),"Money") >= 1000 then setElementData(getLocalPlayer(),"Money",(getElementData(getLocalPlayer(),"Money") or 0)-1000) setElementData(getLocalPlayer(),"Chips", 1) outputChatBox("You have bought a (Chips) for a (Money).", 255, 255, 255, true) else outputChatBox("You don't have enough (Money) to buy a (Chips).", 255, 255, 255, true) end end
-
I know. But, it outputs 'object' or 'vehicle', I can't see 'projectile' on your chatbox while using code below, can you? addEventHandler ( "onClientVehicleDamage", root, function ( attackerElement ) outputChatBox ( getElementModel ( source ) .. ": " .. getElementType ( attackerElement ) ); if ( getElementModel ( source ) ~= 432 ) then return; end cancelEvent ( ); if ( attackerElement and getElementType ( attackerElement ) == "projectile" ) then if ( getProjectileType ( attackerElement ) == 21 ) then triggerServerEvent ( "destroy", localPlayer, source ); end end end );
-
client addEventHandler ( "onClientVehicleDamage", root, function ( attackerElement, weapon ) outputChatBox ( getElementModel ( source ) .. ": " .. weapon ); if ( getElementModel ( source ) ~= 432 ) then return; end cancelEvent ( ); if ( attackerElement and getElementType ( attackerElement ) == "projectile" ) then if ( getProjectileType ( attackerElement ) == 21 ) then triggerServerEvent ( "destroy", localPlayer, source ); end end end ); And now? Strange, because it's not projectile.
-
http://pastebin.com/9eucJu5u I don't get any lags.
-
http://pastebin.com/7gM9QkWs
-
addEventHandler ( "onClientVehicleDamage", root, function ( attackerElement ) outputChatBox ( getElementModel ( source ) .. ": " .. getElementType ( attackerElement ) ); if ( getElementModel ( source ) ~= 432 ) then return; end cancelEvent ( ); if ( attackerElement and getElementType ( attackerElement ) == "projectile" ) then if ( getProjectileType ( attackerElement ) == 21 ) then triggerServerEvent ( "destroy", localPlayer, source ); end end end ); Tell me what chatbox outputs now.