Wysłany: 2016-08-31, 13:26
AlaneqYT
Uczeń LUA
Wiek: 25 Na forum: 3884 dni Posty: 37
Piwa : 20
Witam, mam problem z prawo jazdami, ka?dy mo?e wej?? do auta gdy nie ma prawa jazdy, gdy ma zabrane tez mo?e wej??.
kod:
local categoryA ={[ 463 ] = true ,[ 462 ] = true ,[ 461 ] = true ,[ 581 ] = true ,[ 448 ] = true ,[ 468 ] = true ,[ 471 ] = true ,[ 521 ] = true ,[ 522 ] = true ,[ 523 ] = true }
local categoryB ={[ 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 ,[ 488 ] = true ,[ 460 ] = true ,
[ 469 ] = true ,[ 487 ] = true ,[ 510 ] = true ,[ 509 ] = true ,[ 481 ] = true ,[ 586 ] = true ,[ 472 ] = true ,[ 473 ] = true ,[ 493 ] = true ,[ 595 ] = true ,[ 484 ] = true ,[ 430 ] = true ,[ 453 ] = true ,[ 452 ] = true ,[ 446 ] = true ,[ 454 ] = true ,[ 485 ] = true ,[ 552 ] = true ,
[ 438 ] = true ,[ 574 ] = true ,[ 420 ] = true ,[ 525 ] = true ,[ 408 ] = true ,[ 596 ] = true ,[ 597 ] = true ,[ 427 ] = true ,[ 599 ] = true ,[ 490 ] = true ,[ 432 ] = true ,[ 528 ] = true ,[ 601 ] = true ,[ 407 ] = true ,[ 544 ] = true ,[ 470 ] = true ,[ 598 ] = true ,[ 588 ] = true ,
[ 532 ] = true ,[ 443 ] = true ,[ 486 ] = true ,[ 531 ] = true ,[ 543 ] = true ,[ 422 ] = true ,[ 583 ] = true ,[ 478 ] = true ,[ 605 ] = true ,[ 554 ] = true ,[ 530 ] = true ,[ 418 ] = true ,[ 572 ] = true ,[ 582 ] = true ,[ 536 ] = true ,[ 575 ] = true ,[ 534 ] = true ,
[ 567 ] = true ,[ 535 ] = true ,[ 576 ] = true ,[ 412 ] = true ,[ 402 ] = true ,[ 542 ] = true ,[ 603 ] = true ,[ 475 ] = true ,[ 449 ] = true ,[ 537 ] = true ,[ 570 ] = true ,[ 441 ] = true ,[ 464 ] = true ,[ 501 ] = true ,[ 465 ] = true ,[ 564 ] = true ,[ 568 ] = true ,[ 557 ] = true ,[ 424 ] = true ,[ 504 ] = true ,[ 495 ] = true ,[ 457 ] = true ,[ 539 ] = true ,[ 483 ] = true ,[ 571 ] = true ,[ 500 ] = true ,
[ 444 ] = true ,[ 556 ] = true ,[ 429 ] = true ,[ 411 ] = true ,[ 541 ] = true ,[ 559 ] = true ,[ 415 ] = true ,[ 561 ] = 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 ,
[ 606 ] = true ,[ 607 ] = true ,[ 610 ] = true ,[ 590 ] = true ,[ 569 ] = true ,[ 611 ] = true ,[ 584 ] = true ,[ 608 ] = true ,[ 435 ] = true ,[ 450 ] = true ,[ 591 ] = true ,[ 594 ] = true }
local categoryC ={[ 403 ] = true ,[ 406 ] = true ,[ 413 ] = true ,[ 414 ] = true ,[ 416 ] = true ,[ 423 ] = true ,[ 428 ] = true ,[ 431 ] = true ,[ 433 ] = true ,[ 437 ] = true ,[ 440 ] = true ,[ 455 ] = true ,[ 456 ] = true ,[ 459 ] = true ,[ 482 ] = true ,[ 498 ] = true ,[ 499 ] = true ,[ 508 ] = true ,[ 514 ] = true ,[ 515 ] = true ,[ 524 ] = true ,[ 538 ] = true ,[ 573 ] = true }
addEventHandler ( "onVehicleStartEnter" , resourceRoot , function( plr , seat , jacked )
if seat == 0 then
if categoryA [ getElementModel ( source )] then
if exports [ "ogrpg-prace-settings" ]: getVehicleLicense ( plr , "A" ) then
cancelEvent ()
end
elseif categoryB [ getElementModel ( source )] then
if exports [ "ogrpg-prace-settings" ]: getVehicleLicense ( plr , "B" ) then
cancelEvent ()
end
elseif categoryC [ getElementModel ( source )] then
if exports [ "ogrpg-prace-settings" ]: getVehicleLicense ( plr , "C" ) then
cancelEvent ()
end
end
end
end )
local categoryL ={ 592 , 553 , 577 , 488 , 511 , 497 , 548 , 563 , 512 , 476 , 593 , 447 , 425 , 519 , 520 , 460 , 417 , 469 , 487 , 513 }
-- Tutaj dalsza cze ? c kodu
addEventHandler ( "onVehicleStartEnter" , getRootElement (), function( plr , seat , jacked )
if seat ~= 0 then return end
local queryA = string . format ( "SELECT * FROM ogrpg_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1" , "A" , getPlayerSerial ( plr ))
local resultA = exports [ "ogrpg-db" ]: pobierzWyniki ( queryA )
if ( resultA ) then
cancelEvent ()
outputChatBox ( "* Posiadasz zawieszone prawo jazdy do " .. resultA [ "time" ].. ", za: " .. resultA [ "reason" ], plr , 255 , 0 , 0 )
else
exports [ "ogrpg-db" ]: dbSet ( "DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?" , "A" , getPlayerSerial ( plr ))
end
--[[ ( "..resultA[" type "].." )
local queryB = string . format ( "SELECT * FROM ogrpg_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1" , "B" , getPlayerSerial ( plr ))
local resultB = exports [ "ogrpg-db" ]: pobierzWyniki ( queryB )
if ( resultB ) then
cancelEvent ()
outputChatBox ( "* Posiadasz zawieszone prawo jazdy kat(" .. resultB [ "type" ].. ") do " .. resultB [ "time" ].. ", za: " .. resultB [ "reason" ], plr , 255 , 0 , 0 )
else
exports [ "ogrpg-db" ]: dbSet ( "DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?" , "B" , getPlayerSerial ( plr ))
end
local queryC = string . format ( "SELECT * FROM ogrpg_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1" , "C" , getPlayerSerial ( plr ))
local resultC = exports [ "ogrpg-db" ]: pobierzWyniki ( queryC )
if ( resultC ) then
cancelEvent ()
outputChatBox ( "* Posiadasz zawieszone prawo jazdy kat(" .. resultC [ "type" ].. ") do " .. resultC [ "time" ].. ", za: " .. resultC [ "reason" ], plr , 255 , 0 , 0 )
else
exports [ "ogrpg-db" ]: dbSet ( "DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?" , "C" , getPlayerSerial ( plr ))
end
]]--
--[[ local queryC = string . format ( "SELECT * FROM ogrpg_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1" , "C" , getPlayerSerial ( plr ))
local resultC = exports [ "ogrpg-db" ]: pobierzWyniki ( queryC )
if ( resultC ) then
cancelEvent ()
outputChatBox ( "* Posiadasz zawieszone prawo jazdy kat(" .. resultC [ "type" ].. ") do " .. resultC [ "time" ].. ", za: " .. resultC [ "reason" ], plr , 255 , 0 , 0 )
else
exports [ "ogrpg-db" ]: dbSet ( "DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?" , "C" , getPlayerSerial ( plr ))
end ]]--
--[[if categoryL [ getElementModel ( source )] then
query = string . format ( "SELECT * FROM ogrpg_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1" , "L" , getPlayerSerial ( target ))
local result = exports [ "ogrpg-db" ]: pobierzWyniki ( query )
if ( result ) then
cancelEvent ()
outputChatBox ( "* Posiadasz zawieszone prawo jazdy do " .. result [ "time" ].. ", za: " .. result [ "reason" ], plr , 255 , 0 , 0 )
else
exports [ "ogrpg-db" ]: dbSet ( "DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?" , "L" , getPlayerSerial ( plr ))
end
end ]]-- Kat L zostala zablokowana ]]--
end )
addEventHandler ( "onVehicleEnter" , getRootElement (), function( plr , seat , jacked )
if seat ~= 0 then return end
local queryA = string . format ( "SELECT * FROM ogrpg_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1" , "A" , getPlayerSerial ( plr ))
local resultA = exports [ "ogrpg-db" ]: pobierzWyniki ( queryA )
if ( resultA ) then
setControlState ( plr , "enter_exit" , true )
setTimer ( toggleControl , 3000 , 1 , plr , "enter_exit" , true )
outputChatBox ( "* Posiadasz zawieszone prawo jazdy do " .. resultA [ "time" ].. ", za: " .. resultA [ "reason" ], plr , 255 , 0 , 0 )
else
exports [ "ogrpg-db" ]: dbSet ( "DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?" , "A" , getPlayerSerial ( plr ))
end
end )
[ Dodano : 2016-09-01, 17:23 ]
Pomo?e kto??
Wysłany: 2016-09-07, 19:39
drekuu
Wiek: 46 Na forum: 3847 dni Posty: 16
Nick w MP: drekuu
Piwa : 5
Spr?buj tego
local categoryA ={[ 463 ] = true ,[ 462 ] = true ,[ 461 ] = true ,[ 581 ] = true ,[ 448 ] = true ,[ 468 ] = true ,[ 471 ] = true ,[ 521 ] = true ,[ 522 ] = true ,[ 523 ] = true }
local categoryB ={[ 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 ,[ 488 ] = true ,[ 460 ] = true ,
[ 469 ] = true ,[ 487 ] = true ,[ 510 ] = true ,[ 509 ] = true ,[ 481 ] = true ,[ 586 ] = true ,[ 472 ] = true ,[ 473 ] = true ,[ 493 ] = true ,[ 595 ] = true ,[ 484 ] = true ,[ 430 ] = true ,[ 453 ] = true ,[ 452 ] = true ,[ 446 ] = true ,[ 454 ] = true ,[ 485 ] = true ,[ 552 ] = true ,
[ 438 ] = true ,[ 574 ] = true ,[ 420 ] = true ,[ 525 ] = true ,[ 408 ] = true ,[ 596 ] = true ,[ 597 ] = true ,[ 427 ] = true ,[ 599 ] = true ,[ 490 ] = true ,[ 432 ] = true ,[ 528 ] = true ,[ 601 ] = true ,[ 407 ] = true ,[ 544 ] = true ,[ 470 ] = true ,[ 598 ] = true ,[ 588 ] = true ,
[ 532 ] = true ,[ 443 ] = true ,[ 486 ] = true ,[ 531 ] = true ,[ 543 ] = true ,[ 422 ] = true ,[ 583 ] = true ,[ 478 ] = true ,[ 605 ] = true ,[ 554 ] = true ,[ 530 ] = true ,[ 418 ] = true ,[ 572 ] = true ,[ 582 ] = true ,[ 536 ] = true ,[ 575 ] = true ,[ 534 ] = true ,
[ 567 ] = true ,[ 535 ] = true ,[ 576 ] = true ,[ 412 ] = true ,[ 402 ] = true ,[ 542 ] = true ,[ 603 ] = true ,[ 475 ] = true ,[ 449 ] = true ,[ 537 ] = true ,[ 570 ] = true ,[ 441 ] = true ,[ 464 ] = true ,[ 501 ] = true ,[ 465 ] = true ,[ 564 ] = true ,[ 568 ] = true ,[ 557 ] = true ,[ 424 ] = true ,[ 504 ] = true ,[ 495 ] = true ,[ 457 ] = true ,[ 539 ] = true ,[ 483 ] = true ,[ 571 ] = true ,[ 500 ] = true ,
[ 444 ] = true ,[ 556 ] = true ,[ 429 ] = true ,[ 411 ] = true ,[ 541 ] = true ,[ 559 ] = true ,[ 415 ] = true ,[ 561 ] = 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 ,
[ 606 ] = true ,[ 607 ] = true ,[ 610 ] = true ,[ 590 ] = true ,[ 569 ] = true ,[ 611 ] = true ,[ 584 ] = true ,[ 608 ] = true ,[ 435 ] = true ,[ 450 ] = true ,[ 591 ] = true ,[ 594 ] = true }
local categoryC ={[ 403 ] = true ,[ 406 ] = true ,[ 413 ] = true ,[ 414 ] = true ,[ 416 ] = true ,[ 423 ] = true ,[ 428 ] = true ,[ 431 ] = true ,[ 433 ] = true ,[ 437 ] = true ,[ 440 ] = true ,[ 455 ] = true ,[ 456 ] = true ,[ 459 ] = true ,[ 482 ] = true ,[ 498 ] = true ,[ 499 ] = true ,[ 508 ] = true ,[ 514 ] = true ,[ 515 ] = true ,[ 524 ] = true ,[ 538 ] = true ,[ 573 ] = true }
addEventHandler ( "onVehicleStartEnter" , getRootElement (), function( plr , seat , jacked )
if seat == 0 then
if categoryA [ getElementModel ( source )] then
if exports [ "ogrpg-prace-settings" ]: getVehicleLicense ( plr , "A" ) then
cancelEvent ()
end
elseif categoryB [ getElementModel ( source )] then
if exports [ "ogrpg-prace-settings" ]: getVehicleLicense ( plr , "B" ) then
cancelEvent ()
end
elseif categoryC [ getElementModel ( source )] then
if exports [ "ogrpg-prace-settings" ]: getVehicleLicense ( plr , "C" ) then
cancelEvent ()
end
end
end
end )
local categoryL ={ 592 , 553 , 577 , 488 , 511 , 497 , 548 , 563 , 512 , 476 , 593 , 447 , 425 , 519 , 520 , 460 , 417 , 469 , 487 , 513 }
-- Tutaj dalsza cze ? c kodu
addEventHandler ( "onVehicleStartEnter" , getRootElement (), function( plr , seat , jacked )
if seat ~= 0 then return end
local queryA = string . format ( "SELECT * FROM ogrpg_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1" , "A" , getPlayerSerial ( plr ))
local resultA = exports [ "ogrpg-db" ]: pobierzWyniki ( queryA )
if ( resultA ) then
cancelEvent ()
outputChatBox ( "* Posiadasz zawieszone prawo jazdy do " .. resultA [ "time" ].. ", za: " .. resultA [ "reason" ], plr , 255 , 0 , 0 )
else
exports [ "ogrpg-db" ]: dbSet ( "DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?" , "A" , getPlayerSerial ( plr ))
end
--[[ ( "..resultA[" type "].." )
local queryB = string . format ( "SELECT * FROM ogrpg_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1" , "B" , getPlayerSerial ( plr ))
local resultB = exports [ "ogrpg-db" ]: pobierzWyniki ( queryB )
if ( resultB ) then
cancelEvent ()
outputChatBox ( "* Posiadasz zawieszone prawo jazdy kat(" .. resultB [ "type" ].. ") do " .. resultB [ "time" ].. ", za: " .. resultB [ "reason" ], plr , 255 , 0 , 0 )
else
exports [ "ogrpg-db" ]: dbSet ( "DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?" , "B" , getPlayerSerial ( plr ))
end
local queryC = string . format ( "SELECT * FROM ogrpg_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1" , "C" , getPlayerSerial ( plr ))
local resultC = exports [ "ogrpg-db" ]: pobierzWyniki ( queryC )
if ( resultC ) then
cancelEvent ()
outputChatBox ( "* Posiadasz zawieszone prawo jazdy kat(" .. resultC [ "type" ].. ") do " .. resultC [ "time" ].. ", za: " .. resultC [ "reason" ], plr , 255 , 0 , 0 )
else
exports [ "ogrpg-db" ]: dbSet ( "DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?" , "C" , getPlayerSerial ( plr ))
end
]]--
--[[ local queryC = string . format ( "SELECT * FROM ogrpg_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1" , "C" , getPlayerSerial ( plr ))
local resultC = exports [ "ogrpg-db" ]: pobierzWyniki ( queryC )
if ( resultC ) then
cancelEvent ()
outputChatBox ( "* Posiadasz zawieszone prawo jazdy kat(" .. resultC [ "type" ].. ") do " .. resultC [ "time" ].. ", za: " .. resultC [ "reason" ], plr , 255 , 0 , 0 )
else
exports [ "ogrpg-db" ]: dbSet ( "DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?" , "C" , getPlayerSerial ( plr ))
end ]]--
--[[if categoryL [ getElementModel ( source )] then
query = string . format ( "SELECT * FROM ogrpg_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1" , "L" , getPlayerSerial ( target ))
local result = exports [ "ogrpg-db" ]: pobierzWyniki ( query )
if ( result ) then
cancelEvent ()
outputChatBox ( "* Posiadasz zawieszone prawo jazdy do " .. result [ "time" ].. ", za: " .. result [ "reason" ], plr , 255 , 0 , 0 )
else
exports [ "ogrpg-db" ]: dbSet ( "DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?" , "L" , getPlayerSerial ( plr ))
end
end ]]-- Kat L zostala zablokowana ]]--
end )
addEventHandler ( "onVehicleEnter" , getRootElement (), function( plr , seat , jacked )
if seat ~= 0 then return end
local queryA = string . format ( "SELECT * FROM ogrpg_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1" , "A" , getPlayerSerial ( plr ))
local resultA = exports [ "ogrpg-db" ]: pobierzWyniki ( queryA )
if ( resultA ) then
setControlState ( plr , "enter_exit" , true )
setTimer ( toggleControl , 3000 , 1 , plr , "enter_exit" , true )
outputChatBox ( "* Posiadasz zawieszone prawo jazdy do " .. resultA [ "time" ].. ", za: " .. resultA [ "reason" ], plr , 255 , 0 , 0 )
else
exports [ "ogrpg-db" ]: dbSet ( "DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?" , "A" , getPlayerSerial ( plr ))
end
end )
Wysłany: 2016-09-09, 15:21
mlodasnygo
Wiek: 16 Na forum: 3972 dni Posty: 205
Piwa : 518
Zacznijmy mo?e od tego...
Masz to wgl pod??czone pod mysql i posiadasz wgrane skrypty typu "ogrpg-db"
Jesli nie, to bez tego prawie nic nie ma prawa dzia?a?
Podpis
600 dni -
10 marca 2017
500 piw -
10 marca 2017
Wysłany: 2016-09-10, 10:30
MIKAELmta
Wiek: 24 Na forum: 3978 dni Posty: 311
Piwa : 10617
Aby zadzia?a?o musisz pod??czy? ca?y gm ogrpg do MySQL. W tym kodzie chyba s? te? bugi, ale zacznijmy od tego po??czenia.
Wysłany: 2016-09-10, 20:19
AlaneqYT
Uczeń LUA
Wiek: 25 Na forum: 3884 dni Posty: 37
Piwa : 20
Nie jestem takim idiot?...
Po co nabijacie sobie posty pisz?c
" masz podlaczone majsqel?'
na razie temat do zamkni?cia bo nie potrzebuje ju? tego.
oczywi?cie piwka lec?.
Tagi: prawo :: jazdy
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: