• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

potrzebuje przerobic 2 skrypty

Retired

New Member
Joined
Apr 19, 2009
Messages
233
Reaction score
1
witam was drodzy otlandowicze mam do was sprawe potrzebuje przerobic skrypt na mojego noob ots pomozecie? za rep oczewiscie
a oto skrypt:
function onKill(cid, target)
if isPlayer(target) == TRUE then
if getPlayerIp(cid) ~= getPlayerIp(target) then
loot = 2152
item = doPlayerAddItem(cid,loot,1)
elseif getPlayerName(cid) == getPlayerName(target) then
doPlayerAddItem(cid,loot,1)
else
doPlayerAddExperience(cid, -1000000)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You have been punished for killing a player of the same IP.")
end
end
return TRUE
end
czy by mogl ktos przerobic tak ten skrypt zeby po podlozeniu sie koledze 3x z rzedu za 4 razem 2 postacie padaja i to samo z mc(osoba o tym samym ip zabija 2 osobe= dwie osoby padaja) i jesli mozna za zabicie gracza (tylko podczas zdobycia fraga) gracz dostaje nagrode do backpacka id xxxx
z gory dziekuje
 
zamiast oddejmowania lvli chce aby gracz padl,tak samo gdy koles sie podklada drugiemu kolesiowi po trzech zabiciach z rzedu tego samego gracza padaja obydwaj
 
zeby padl uzyj

doCreatureAddHealth(cid, -1000000000)
doCreatureAddHealth(target, -1000000000)
 
Zajebiscie sie czyta ten twoj skrypt w Quote, co nie?
I zmienne definiuj jako local, a najlepiej w ogóle ich nie definiuj jeżeli wykorzystujesz je tylko raz, i przechowujesz w nich tylko id..

Code:
function onKill(cid, target)
    if isPlayer(target) == TRUE then
        if(getPlayerIp(cid) ~= getPlayerIp(target)) then
         -- pusto?..
        elseif(getPlayerName(cid) == getPlayerName(target)) then
          doPlayerAddItem(cid, 2152,1)
        else
          doPlayerAddExperience(cid, -1000000)
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have been punished for killing a player of the same IP.")
        end
    end
    return TRUE
end
 
W mysql
Code:
CREATE TABLE IF NOT EXISTS `kille` (
  `id` int(11) NOT NULL auto_increment,
  `zabil` int(11) NOT NULL,
  `padl` int(11) NOT NULL,
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

Tera takie coś z twoim skryptem
Code:
function onKill(cid, target)

local loot = 2152
local item = doPlayerAddItem(cid,loot,1)
if isPlayer(target) == TRUE then
if getPlayerIp(cid) ~= getPlayerIp(target) then
local check = db.getResult("SELECT `id` FROM `kille` WHERE `zabil` = " .. getPlayerGUID(cid) .. " AND `padl` = " .. getPlayerGUID(target) .. ";")
if(check:getID() == -1) then
doPlayerAddItem(cid,loot,1)
db.executeQuery("INSERT INTO `kille` VALUES (NULL," .. getPlayerGUID(cid) .. "," .. getPlayerGUID(target) .. ");") 
elseif(check:getRows(true) >= 3) then
doCreatureAddHealth(cid, -1000000000)
doCreatureAddHealth(target, -1000000000)
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "zajebales juz 3 razy tego samego gracza.")
else
doPlayerAddItem(cid,loot,1)
db.executeQuery("INSERT INTO `kille` VALUES (NULL," .. getPlayerGUID(cid) .. "," .. getPlayerGUID(target) .. ");") 
end
else
doCreatureAddHealth(cid, -1000000000)
doCreatureAddHealth(target, -1000000000)
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have been punished for killing a player of the same IP.")

end
end
return TRUE
end

nie testowałem ;)
 
taki blad wywalilo gdy prubowalem dodac
Błąd

zapytanie SQL:

CREATE TABLE IF NOT EXISTS `kille` (
`id` int( 11 ) NOT NULL AUTO_INCREMENT ,
`zabil` int( 11 ) NOT NULL ,
`padl` int( 11 ) NOT NULL ,
) ENGINE = MYISAM DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci AUTO_INCREMENT =1


MySQL zwrócił komunikat:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1' at line 5
 
Code:
CREATE TABLE IF NOT EXISTS `kille` (
`id` int( 11 ) NOT NULL AUTO_INCREMENT ,
`zabil` int( 11 ) NOT NULL ,
`padl` int( 11 ) NOT NULL ,
  PRIMARY KEY  (`id`)
) ENGINE = MYISAM DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci AUTO_INCREMENT =1 ;

masz
 
taki blad wywalilo gdy prubowalem dodac

PHP:
 CREATE TABLE IF NOT EXISTS `kille` (
	`id` int(11) NOT NULL auto_increment,
	`zabil` int(11) NOT NULL default '1',
	`padl` int(11) NOT NULL default '1',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
 
Back
Top