Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - SHy^
1
Off-Topic General / A suggestion related to bumps
« on September 26th, 01:49 PM »
A ban from posting for atleast 2 weeks or more should be given upon bumping old topics with just a useless post like: "wHo hAs tHiS sCrIpT pM mE!!!". For just any useless bumps. It been enough, seeing people bumping old topics with last post made in 2015. Beta testers are only moderators right now, I guess. Let's see what community says( except people who bump old topics uselessly)

Thanks.
2
Snippet Showroom / Mute System with timers
« on September 21st, 06:36 PM »
Well, just learned table today so thought to make a something so I decided to make mute system, tested it and sharing it with 0 errors as I tested. ;D

(click to show/hide)

In top of script:
Code: [Select]
mute <- {};

onPlayerJoin:
Code: [Select]
mute.rawset( player.ID, {} );

onPlayerChat:
Code: [Select]
if ( mute.rawget(player.ID).rawin("muted") ) return MessagePlayer("[#ff0000]Error! You're muted, wait mute to expire.", player);

onPlayerPart:
Code: [Select]
if ( mute.rawget(player.ID).rawin("muted")) mute.rawget(playerr.ID).rawdelete("muted");

Function:
Code: [Select]
function Unmute(p)
{
local plr = FindPlayer(p);
if ( plr && mute.rawget(plr.ID).rawin("muted"))
{
mute.rawget(plr.ID).rawdelete("muted");
Message(format("Automuted %s Reason: Mute time expired!", plr.Name));
}
}

onPlayerCommand:
Code: [Select]
if ( cmd == "mute")
{
if (!text) return MessagePlayer("Error - use /mute <player> <min:sec> <reason>.", player);
else
{
         local plr = GetPlayer( GetTok(text, " ", 1));
         local tym =  GetTok(text, " ", 2);
         local reason = GetTok(text, " ", 3, NumTok(text, " "));
if ( !plr) return MessagePlayer("Error - unknown plr.", player);
else if (!tym) return MessagePlayer("Error - use /mute <player> <sec> <reason>.", player);
else if (!reason) return MessagePlayer("Error - use /mute <player> <sec> <reason>.", player);
else if ( !IsNum(tym)) return MessagePlayer("Input secs as integer or float, noob.", player);
else if ( tym.tointeger() < 15 ) return MessagePlayer("Error! Minimum secs are 15.", player);
else if ( mute.rawget(plr.ID).rawin("muted") ) return MessagePlayer("Error! Requested plr already muted.", player);
else
{
         mute.rawget(plr.ID).rawset("muted", true);
UnmuteTimer <-  NewTimer("Unmute", tym.tointeger()*1000, 1, plr.ID);
Message("Admin "+player.Name+" muted "+plr.Name+" Time: "+tym.tointeger()+" seconds, Reason added: "+reason+"");
}
}
}
else if ( cmd == "unmute")
{
if (!text) return MessagePlayer("Error - use /unmute <player> .", player);
else
{
local plr = FindPlayer(text);
if (!plr) return MessagePlayer("Error - unknown plr.", player);
else if ( !mute.rawget(plr.ID).rawin("muted")) return MessagePlayer("Error! requested plr not muted.", player);
else
{
            mute.rawget(plr.ID).rawdelete("muted");
UnmuteTimer.Stop();
Message(format("Admin %s unmuted %s", player.Name, plr.Name));
}
}
}

If you find any bug from somewhere, report it to me in PM and I'll try to fix it immediately. ::)

Note: Due to lack of time, I didn't add GetTok, NumTok & GetPlayer functions. Search on the forum & you'll find it.
3
Client Scripting / [ Hud Bars ] Health and Armour UI Bar
« on September 12th, 02:26 PM »
It's scripted in DecUI and without decui, it won't work. The code is moved to https://pastebin.com/MbKPPiB3 for better formatting. Feel free to post bugs. The code might be improved so tell in the reply :)

How does it looks:


https://youtu.be/aahNiiDfOX4
 

4
Snippet Showroom / [ Account system ] v0.1 by SHy
« on August 1st, 05:08 PM »
Hi, I made a account system which I would like to release in the forum. It might have some bugs but I tested everything and found no bugs. I hope y'all will appreciate me :D .

Commands: register, login, setautologin( or autologin ), setpass, stats, deposit, withdraw, givecash, bank( or cash).

Note: The bank system is simple and does NOT requires the user to be in bank, if you want to have the player in a specific place ( bank ), try adding it yourself. The system contains IP+Uid+Uid2 saved for autologin or other stuff. If you find any bug, please report it to me here or in PM and I'll try to fix it asap,. Some functions are NOT made by me.

Credits:
Me :P
SLC for GetTok, NumTok and GetPlayer functions.

Link:
(click to show/hide)
Github

5
Snippet Showroom / [ Simple ] Deathpos / Diepos!
« on July 20th, 04:22 PM »
Hey guys. I'm here sharing a simple deathpos/diepos command made by me(beginner). Hope you all like it :D

(click to show/hide)
Class(Your main player class):
Code: [Select]
DP = false;

onScriptLoad:

Code: [Select]
deathpos <- array( GetMaxPlayers(), null );
onPlayerDeath:
Code: [Select]
if ( stats[ player.ID ].DP )
{
deathpos[ player.ID ] = player.Pos;
}
onPlayerSpawn:
Code: [Select]
if ( stats[ player.ID ].DP ) {
player.Pos = deathpos[ player.ID ];
PrivMessage( player, "You have been teleported to the place where you had last died.");
}
onPlayerCommand:
Code: [Select]
else if ( cmd == "deathpos" )
{
if (!text) PrivMessage( player, "Error: Wrong syntax, Use /"+cmd+" <on/off>.");
else
{
if ( text == "on" )
{
if ( stats[ player.ID ].DP ) PrivMessage( player, "Deathpos already enabled.");
else
{
stats[ player.ID ].DP = true;
MessagePlayer("Deathpos enabled.", player);
}
}
else if ( text == "off" )
{
if ( !stats[ player.ID ].DP ) PrivMessage( player, "You had not enabled deathpos.");
else
{
stats[ player.ID ].DP = false;
PrivMessage( player, "Deathpos has been turned off.");
}
}
}
}
Note: It won't save the deathpos details in database.I have used stats as an array for my default player class, you should change it according to your script. Before posting an error, confirm that all the indexes are there and you have pasted it correctly.
Hope someone finds it helpful!

Tested.