• 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!

War system :)

Ates.tr

Im back
Joined
Nov 11, 2007
Messages
1,046
Reaction score
2
Location
Sweden
Can anyone make me a war system script ? like chrstiandb have in hes server ?


Like auto count frag's and shiet ;) thanks <3!
 
Frag's saving in storage value (for Self I have more advanced system for self - my pvp enfo serv - mayby public it later) :D
PHP:
function onDeath(cid, corpse, killer)
  local frag_stor = 1212 -- storage value for frags.
  
  local getFrag = getPlayerStorageValue(cid, frag_stor)

   if(isPlayer(killer) and isPlayer(cid))then
    setPlayerStorageValue(cid, frag_stor, getFrag+1)
   end
 return TRUE
end
 
PHP:
function onDeath(cid, corpse, killer)
  local frag_stor = 1212 -- storage value for frags.
  
  local getFrag = getPlayerStorageValue(cid, frag_stor)

   if(isPlayer(killer) and isPlayer(cid))then
    setPlayerStorageValue(cid, frag_stor, getFrag+1)
   end
 return TRUE
end

He meant war system m8 ;p he wants only war frags counts ;d
Write exactly what features you need, list them ;p
 
He meant war system m8 ;p he wants only war frags counts ;d
Write exactly what features you need, list them ;p

I need like Naruhto did for christianDB, its like you can click in site war system something , and there you like accept 2 teams and its like XXX VS YYY (5-1) frags...

my english bad so hard to tell ^^
 
its a full system.
-guilds can invite others guilds to war.
-if they are in war, they dont get frags.
-deaths in wars are registered.
-web show pending invitations and scores.
 
omfg^^
you just have to give every player on login a storage if he is in war and which guild he is fighing for.
then on death you check if both players are in war, if yes, then you add the killers team one point (for example in the database).
now you can handle with this database logs to make a nice statistik on your website...

there are serveral scripts that have been postet on this forum (for FREE) which were about 10 times more difficult!
 
You could do this in several ways... If you pretty much only want to use storage values, here is an option:
- Set global storage value + guild id (e.g. 4000 + guildid) to 1 if that guild is in war.
- When someone die, you check "getGlobalStorageValue(4000 + getPlayerGuildId(cid))" if the value is ">= 0" then it will increase it.


That's a base!
 
omfg^^
you just have to give every player on login a storage if he is in war and which guild he is fighing for.
then on death you check if both players are in war, if yes, then you add the killers team one point (for example in the database).
now you can handle with this database logs to make a nice statistik on your website...

there are serveral scripts that have been postet on this forum (for FREE) which were about 10 times more difficult!

It's a bit harder than you think.
 
It's a bit harder than you think.

It is not :) Well I suppose Nahruto created a new table in the database, but that does not at all make it more advanced. Just more structured, but it's same if you use storage values :)

Although, I guess I'd have made a new table myself. Or maybe just added 2 new fields to guild table, one for the guildid of target guild and one for "guild kills", if you don't wish to add it personally to a storage value and then make an SQL query to check all the members of the guilds storage values to get their frags and sum them :p

Thus, using storage values is more easy and yet a completely working way.

Just figure which storages to use for what, the ones I told you are good, and you'd need another one to check which guild you war against, you could use the same base by making a base value and + it with guildid to see which guild you war against.

The "no frags", I think it's just to return FALSE (0) in onDeath script as the source code (C++) will handle your function and check if it returns 0, if it does it will not continue. And this is done by the way he said, just check if they are having war by checking global storage + guildid and return FALSE if that is the case :)
 
Back
Top