Jump to content

!country command


Recommended Posts

Dunno if this is possible, but it would be nice to have this command in next versions of silent mod, cuz often happends that sum players connect on my server and I dont recognize that flag nd rly would like to know it, and mostly they dont even answer, so if this is not a problem to be made, would be great! ty
Link to comment
Share on other sites

This will only work if the uci numbers = Countries table

-- Author Sol
countries = {
[0]= "Unknown",
[1]= "Asia/Pacific Region",
[2]= "Europe",
[3]= "Andorra",
[4]= "United Arab Emirates",
[5]= "Afghanistan",
[6]= "Antigua and Barbuda",
[7]= "Anguilla",
[8]= "Albania",
[9]= "Armenia",
[10]= "Netherlands Antilles",
[11]= "Angola",
[12]= "Antarctica",
[13]= "Argentina",
[14]= "American Samoa",
[15]= "Austria",
[16]= "Australia",
[17]= "Aruba",
[18]= "Azerbaijan",
[19]= "Bosnia and Herzegovina",
[20]= "Barbados",
[21]= "Bangladesh",
[22]= "Belgium",
[23]= "Burkina Faso",
[24]= "Bulgaria",
[25]= "Bahrain",
[26]= "Burundi",
[27]= "Benin",
[28]= "Bermuda",
[29]= "Brunei Darussalam",
[30]= "Bolivia",
[31]= "Brazil",
[32]= "Bahamas",
[33]= "Bhutan",
[34]= "Bouvet Island",
[35]= "Botswana",
[36]= "Belarus",
[37]= "Belize",
[38]= "Canada",
[39]= "Cocos (Keeling) Islands",
[40]= "Congo-Kinshasa",
[41]= "Central African Republic",
[42]= "Congo-Brazzaville",
[43]= "Switzerland",
[44]= "Cote D'Ivoire",
[45]= "Cook Islands",
[46]= "Chile",
[47]= "Cameroon",
[48]= "China",
[49]= "Colombia",
[50]= "Costa Rica",
[51]= "Cuba",
[52]= "Cape Verde",
[53]= "Christmas Island",
[54]= "Cyprus",
[55]= "Czech Republic",
[56]= "Germany",
[57]= "Djibouti",
[58]= "Denmark",
[59]= "Dominica",
[60]= "Dominican Republic",
[61]= "Algeria",
[62]= "Ecuador",
[63]= "Estonia",
[64]= "Egypt",
[65]= "Western Sahara",
[66]= "Eritrea",
[67]= "Spain",
[68]= "Ethiopia",
[69]= "Finland",
[70]= "Fiji",
[71]= "Falkland Islands (Malvinas)",
[72]= "Micronesia",
[73]= "Faroe Islands",
[74]= "France",
[75]= "France, Metropolitan",
[76]= "Gabon",
[77]= "United Kingdom",
[78]= "Grenada",
[79]= "Georgia",
[80]= "French Guiana",
[81]= "Ghana",
[82]= "Gibraltar",
[83]= "Greenland",
[84]= "Gambia",
[85]= "Guinea",
[86]= "Guadeloupe",
[87]= "Equatorial Guinea",
[88]= "Greece",
[89]= "South Georgia and the South Sandwich Islands",
[90]= "Guatemala",
[91]= "Guam",
[92]= "Guinea-Bissau",
[93]= "Guyana",
[94]= "Hong Kong",
[95]= "Heard Island and McDonald Islands",
[96]= "Honduras",
[97]= "Croatia",
[98]= "Haiti",
[99]= "Hungary",
[100]= "Indonesia",
[101]= "Ireland",
[102]= "Israel",
[103]= "India",
[104]= "British Indian Ocean Territory",
[105]= "Iraq",
[106]= "Iran",
[107]= "Iceland",
[108]= "Italy",
[109]= "Jamaica",
[110]= "Jordan",
[111]= "Japan",
[112]= "Kenya",
[113]= "Kyrgyzstan",
[114]= "Cambodia",
[115]= "Kiribati",
[116]= "Comoros",
[117]= "Saint Kitts and Nevis",
[118]= "North Korea",
[119]= "South Korea",
[120]= "Kuwait",
[121]= "Cayman Islands",
[122]= "Kazakhstan",
[123]= "Laos",
[124]= "Lebanon",
[125]= "Saint Lucia",
[126]= "Liechtenstein",
[127]= "Sri Lanka",
[128]= "Liberia",
[129]= "Lesotho",
[130]= "Lithuania",
[131]= "Luxembourg",
[132]= "Latvia",
[133]= "Libya",
[134]= "Morocco",
[135]= "Monaco",
[136]= "Moldova",
[137]= "Madagascar",
[138]= "Marshall Islands",
[139]= "Macedonia",
[140]= "Mali",
[141]= "Burma",
[142]= "Mongolia",
[143]= "Macau",
[144]= "Northern Mariana Islands",
[145]= "Martinique",
[146]= "Mauritania",
[147]= "Montserrat",
[148]= "Malta",
[149]= "Mauritius",
[150]= "Maldives",
[151]= "Malawi",
[152]= "Mexico",
[153]= "Malaysia",
[154]= "Mozambique",
[155]= "Namibia",
[156]= "New Caledonia",
[157]= "Niger",
[158]= "Norfolk Island",
[159]= "Nigeria",
[160]= "Nicaragua",
[161]= "Netherlands",
[162]= "Norway",
[163]= "Nepal",
[164]= "Nauru",
[165]= "Niue",
[166]= "New Zealand",
[167]= "Oman",
[168]= "Panama",
[169]= "Peru",
[170]= "French Polynesia",
[171]= "Papua New Guinea",
[172]= "Philippines",
[173]= "Pakistan",
[174]= "Poland",
[175]= "Saint Pierre and Miquelon",
[176]= "Pitcairn Islands",
[177]= "Puerto Rico",
[178]= "Palestinian Territory",
[179]= "Portugal",
[180]= "Palau",
[181]= "Paraguay",
[182]= "Qatar",
[183]= "Reunion",
[184]= "Romania",
[185]= "Russian Federation",
[186]= "Rwanda",
[187]= "Saudi Arabia",
[188]= "Solomon Islands",
[189]= "Seychelles",
[190]= "Sudan",
[191]= "Sweden",
[192]= "Singapore",
[193]= "Saint Helena",
[194]= "Slovenia",
[195]= "Svalbard and Jan Mayen",
[196]= "Slovakia",
[197]= "Sierra Leone",
[198]= "San Marino",
[199]= "Senegal",
[200]= "Somalia",
[201]= "Suriname",
[202]= "Sao Tome and Principe",
[203]= "El Salvador",
[204]= "Syria",
[205]= "Swaziland",
[206]= "Turks and Caicos Islands",
[207]= "Chad",
[208]= "French Southern Territories",
[209]= "Togo",
[210]= "Thailand",
[211]= "Tajikistan",
[212]= "Tokelau",
[213]= "Turkmenistan",
[214]= "Tunisia",
[215]= "Tonga",
[216]= "Timor-Leste",
[217]= "Turkey",
[218]= "Trinidad and Tobago",
[219]= "Tuvalu",
[220]= "Taiwan",
[221]= "Tanzania",
[222]= "Ukraine",
[223]= "Uganda",
[224]= "United States Minor Outlying Islands",
[225]= "United States",
[226]= "Uruguay",
[227]= "Uzbekistan",
[228]= "Holy See (Vatican City State)",
[229]= "Saint Vincent and the Grenadines",
[230]= "Venezuela",
[231]= "Virgin Islands, British",
[232]= "Virgin Islands, U.S.",
[233]= "Vietnam",
[234]= "Vanuatu",
[235]= "Wallis and Futuna",
[236]= "Samoa",
[237]= "Yemen",
[238]= "Mayotte",
[239]= "Serbia",
[240]= "South Africa",
[241]= "Zambia",
[242]= "Montenegro",
[243]= "Zimbabwe",
[244]= "Anonymous Proxy",
[245]= "Satellite Provider",
[246]= "Other",
[247]= "Aland Islands",
[248]= "Guernsey",
[249]= "Isle of Man",
[250]= "Jersey",
[251]= "Saint Barthelemy",
[252]= "Saint Martin",
[255]= "Localhost",
}
function et_ClientCommand( num, cmd )
if cmd ~= "say" then
return
end

if et.trap_Argv(1) == "!country" then
local target = tonumber(et.trap_Argv(2))
local uci = et.Info_ValueForKey(et.trap_GetConfigstring( et.CS_PLAYERS + target ), "uci")
et.trap_SendServerCommand( num, string.format("c %s ^wis from %s", et.gentity_get(target, "pers.netname"), countries[uci]) )
end
end

Edited by Sol
Link to comment
Share on other sites

  • Management

You need to copy paste the script from the post into a file, place that file inside the silent folder and the add that file name you made to the lua_modules cvar.

 

We can consider adding this feature to the mod. But I think it would be similar to the Lua script here and maybe it would be better to keep this as an optional script?

Link to comment
Share on other sites

You need to copy paste the script from the post into a file, place that file inside the silent folder and the add that file name you made to the lua_modules cvar.

 

We can consider adding this feature to the mod. But I think it would be similar to the Lua script here and maybe it would be better to keep this as an optional script?

 

well i think it would be great to add it in mod, cuz not many people would bother doing this, but that command definetly cant hurt anyone, its very useful actually :)

Link to comment
Share on other sites

I didn't test it yet, probably doesn't work because of et.trap_SendServerCommand() func.

try to replace

et.trap_SendServerCommand( num, string.format("c %s ^wis from %s", et.gentity_get(target, "pers.netname"), countries[uci]) )

to

et.trap_SendConsoleCommand( et.EXEC_APPEND, string.format("chat %s ^wis from %s\n", et.gentity_get(target, "pers.netname"), countries[uci]))

Link to comment
Share on other sites

  • 1 year later...
×
×
  • Create New...