What's new

Prosba o skrypt

Status
Not open for further replies.

Kolokim

User
Joined
Jun 23, 2011
Messages
28
Reaction score
0
Potrzebuje skrypt ktory dawal bym 3 pkt pierwszym 100 gracza ktorzy wbija 150 lvl. Prosze rowniez o dokladna instrukcje instalacji skrypta tzn czy trzeba go gdzie zarejestrowac albo cos. Bardzo prosze o pomoc
 

ErMex

Egzekucja
Joined
Dec 1, 2010
Messages
574
Reaction score
181
Odp: Prosba o skrypt

3 pkt do item shopu, do bazy danych czy po prostu na zasadzie storage?
 

Kolokim

User
Joined
Jun 23, 2011
Messages
28
Reaction score
0
Odp: Prosba o skrypt

Nie dostawal by item id 2159 i dostal by 3 takie itemy
 

iSanto

Demetri-World.net
Joined
Jan 8, 2011
Messages
922
Reaction score
87
Odp: Prosba o skrypt

Pisa?em Ci ju? taki skrypt:


wystarczy zamieni?: [lua]newlevel >= 100[/lua] na [lua]newlevel >= 150[/lua]

data>creaturescripts>creaturescripts.xml
[xml]<event type="advance" name="freePremiumPoints" event="script" value="points_for_level.lua"/>[/xml]
data>creaturescripts>login.lua
Dodaj gdzie?:
[lua]registerCreatureEvent(cid, "freePremiumPoints")[/lua]
 

Kolokim

User
Joined
Jun 23, 2011
Messages
28
Reaction score
0
Odp: Prosba o skrypt

[LUA]function onAdvance(cid, type, oldlevel, newlevel)
local storage_global = 5101
local storage_player = 5101
local manys = 100

if not (oldlevel ~= newlevel and type == SKILL__LEVEL) then
return true
end
if not (newlevel >= 150 and getGlobalStorageValue(storage_global) <= manys and getPlayerStorageValue(cid, storage_player) == -1) then
return true
end
if getStorage(storage_global) == -1 then
setPlayerStorageValue(cid, storage_player, 0)
end
db.executeQuery('UPDATE `accounts` SET `premium_points` = `premium_points` + 3 WHERE `id` = '.. getPlayerAccountId(cid) ..';')
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You got 3 premium points for reached 150 lvl.")
doBroadcastMessage("Player "..getPlayerName(cid).." has got 3 premium points for reached 150 lvl. Was only " ..manys.. " reward for adewence 150 level" )
setGlobalStorageValue(cid, storage_global, getStorage(storage_global)+1)
setPlayerStorageValue(cid, storage_player, 1)
return true
end [/LUA]

Mam ogolnie taki skrypt wszystko mi ladnie chodzi ale chcialem zeby tylko PIERWSZE 100 KONT moglo dostac te pkt za wbica lvla, a tak to mozna sobie robic pkt w nieskonczonosc. Prosze o pomoc
 

iSanto

Demetri-World.net
Joined
Jan 8, 2011
Messages
922
Reaction score
87
Odp: Prosba o skrypt

Jest w tym skrypcie blokada, ?e tylko 100 pierwszych graczy dostanie punkty.
 
Status
Not open for further replies.
Top