Evil-Cod3r Posted March 1, 2012 Posted March 1, 2012 Hi all i want make a script that check the Players skin and cars if they was original then he can play else kill him or kick him with msg "Not allowed to Remove tha original Files Please restor it to play" checkModels = {" 602, 545, 496, 517, 401, 410, 518, 600, 527, 436, 589, 580, 419, 439, 533, 549, 526, 491, 474, 445, 467, 604, 426, 507, 547, 585, 405, 587, 409, 466, 550, 492, 566, 546, 540, 551, 421, 516, 529, 485, 552, 431, 438, 437, 574, 420, 525, 408, 416, 596, 433, 597, 427, 599, 490, 432, 528, 601, 407, 428, 544, 470, 598, 499, 588, 609, 403, 498, 514, 524, 423, 532, 414, 578, 443, 486, 515, 531, 456, 455, 459, 543, 422, 583, 482, 478, 605, 554, 530, 418, 572, 582, 413, 440, 536, 575, 534, 567, 535, 576, 412, 402, 542, 603, 475, 441, 564, 568, 424, 504, 495, 457, 483, 508, 71, 500, 429, 411, 541, 559, 415, 61, 480, 560, 562, 506, 565, 451, 434, 558, 494, 555, 502, 477, 503, 579, 400, 404, 489, 505, 479, 442, 458, 45, 18, 10, 62, 162, 23, 29, 49, 46, 53, 60, 97, 108, 123, 137, 160, 170, 188, 212, 230, 285 "} function handleOnPlayerModInfo ( filename, modList ) for _,mod in ipairs(modList) do for _,checkName in ipairs(checkModels) do if mod.name == checkName then killPed(source) outputChatBox ( "Not allowed to used modified weapons. Please restore The original" .. filename ) else outputChatBox("You Ped Model is Clean Enjoy Playing") end end end end addEventHandler ( "onPlayerModInfo", getRootElement(), handleOnPlayerModInfo )
drk Posted March 1, 2012 Posted March 1, 2012 Hi all i want make a script that check the Players skin and cars if they was original then he can play else kill him or kick him with msg "Not allowed to Remove tha original Files Please restor it to play" checkModels = {" 602, 545, 496, 517, 401, 410, 518, 600, 527, 436, 589, 580, 419, 439, 533, 549, 526, 491, 474, 445, 467, 604, 426, 507, 547, 585, 405, 587, 409, 466, 550, 492, 566, 546, 540, 551, 421, 516, 529, 485, 552, 431, 438, 437, 574, 420, 525, 408, 416, 596, 433, 597, 427, 599, 490, 432, 528, 601, 407, 428, 544, 470, 598, 499, 588, 609, 403, 498, 514, 524, 423, 532, 414, 578, 443, 486, 515, 531, 456, 455, 459, 543, 422, 583, 482, 478, 605, 554, 530, 418, 572, 582, 413, 440, 536, 575, 534, 567, 535, 576, 412, 402, 542, 603, 475, 441, 564, 568, 424, 504, 495, 457, 483, 508, 71, 500, 429, 411, 541, 559, 415, 61, 480, 560, 562, 506, 565, 451, 434, 558, 494, 555, 502, 477, 503, 579, 400, 404, 489, 505, 479, 442, 458, 45, 18, 10, 62, 162, 23, 29, 49, 46, 53, 60, 97, 108, 123, 137, 160, 170, 188, 212, 230, 285 "} function handleOnPlayerModInfo ( filename, modList ) for _,mod in ipairs(modList) do for _,checkName in ipairs(checkModels) do if mod.name == checkName then killPed(source) outputChatBox ( "Not allowed to used modified weapons. Please restore The original" .. filename ) else outputChatBox("You Ped Model is Clean Enjoy Playing") end end end end addEventHandler ( "onPlayerModInfo", getRootElement(), handleOnPlayerModInfo ) The table is for dff and txd files, not for id's.
Kenix Posted March 1, 2012 Posted March 1, 2012 (edited) Try Server addEvent( 'onStartModInfo', true ) local tModInfo = { } addEventHandler ( 'onPlayerModInfo', root, function( filename, modList ) tModInfo[ source ] = modList end ) addEventHandler ( 'onPlayerQuit', root, function( ) tModInfo[ source ] = nil end ) addEventHandler ( 'onStartModInfo', root, function( ) triggerClientEvent( 'onClientStartModInfo',source,tModInfo[ source ] ) end ) Client addEvent ( 'onClientStartModInfo', true ) local checkModels = { [602] = true; [545] = true; [496] = true; [517] = true; [401] = true; [410] = true; [518] = true; [600] = true; [527] = true; [436] = true; [589] = true; [580] = true; [419] = true; [439] = true; [533] = true; [549] = true; [526] = true; [491] = true; [474] = true; [445] = true; [467] = true; [604] = true; [426] = true; [507] = true; [547] = true; [585] = true; [405] = true; [587] = true; [409] = true; [466] = true; [550] = true; [492] = true; [566] = true; [546] = true; [540] = true; [551] = true; [421] = true; [516] = true; [529] = true; [485] = true; [552] = true; [431] = true; [438] = true; [437] = true; [574] = true; [420] = true; [525] = true; [408] = true; [416] = true; [596] = true; [433] = true; [597] = true; [427] = true; [599] = true; [490] = true; [432] = true; [528] = true; [601] = true; [407] = true; [428] = true; [544] = true; [470] = true; [598] = true; [499] = true; [588] = true; [609] = true; [403] = true; [498] = true; [514] = true; [524] = true; [423] = true; [532] = true; [414] = true; [578] = true; [443] = true; [486] = true; [515] = true; [531] = true; [456] = true; [455] = true; [459] = true; [543] = true; [422] = true; [583] = true; [482] = true; [478] = true; [605] = true; [554] = true; [530] = true; [418] = true; [572] = true; [582] = true; [413] = true; [440] = true; [536] = true; [575] = true; [534] = true; [567] = true; [535] = true; [576] = true; [412] = true; [402] = true; [542] = true; [603] = true; [475] = true; [441] = true; [564] = true; [568] = true; [424] = true; [504] = true; [495] = true; [457] = true; [483] = true; [508] = true; [71] = true; [500] = true; [429] = true; [411] = true; [541] = true; [559] = true; [415] = true; [61] = true; [480] = true; [560] = true; [562] = true; [506] = true; [565] = true; [451] = true; [434] = true; [558] = true; [494] = true; [555] = true; [502] = true; [477] = true; [503] = true; [579] = true; [400] = true; [404] = true; [489] = true; [505] = true; [479] = true; [442] = true; [458] = true; [45] = true; [18] = true; [10] = true; [62] = true; [162] = true; [23] = true; [29] = true; [49] = true; [46] = true; [53] = true; [60] = true; [97] = true; [108] = true; [123] = true; [137] = true; [160] = true; [170] = true; [188] = true; [212] = true; [230] = true; [285] = true; } addEventHandler ( 'onClientStartModInfo', root, function ( modList ) if modList then for _,mod in pairs( modList ) do for index,checkName in pairs( checkModels ) do local nModel = engineGetModelIDFromName ( mod.name:sub( 1,#mod.name - 4 ) ) if nModel == index then setElementHealth( source, 0 ) outputChatBox ( "Not allowed to used modified weapons. Please restore The original" ) else outputChatBox( "You Ped Model is Clean Enjoy Playing" ) end end end end end ) triggerServerEvent( 'onStartModInfo', localPlayer ) Again updated. Edited March 1, 2012 by Guest
Evil-Cod3r Posted March 1, 2012 Author Posted March 1, 2012 i alredy try i remove all the tabel and make it { "sniper.txd"} only not work and no errors
Evil-Cod3r Posted March 1, 2012 Author Posted March 1, 2012 its say client triggerd server side but event is not added to server side !
Kenix Posted March 1, 2012 Posted March 1, 2012 Updated. My bad Not changed event name, when writing code.
Evil-Cod3r Posted March 1, 2012 Author Posted March 1, 2012 i start the script not work and no errors
Kenix Posted March 1, 2012 Posted March 1, 2012 (edited) i start the script not work and no errors Forgot cut and paste checkModels table in client .... Probably, because I want to sleep. Try again . Updated. Edited March 1, 2012 by Guest
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