Recent Posts
1
Snippet Showroom / Mute System with timers
« Yesterday at 06:36 PM by Shy »
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.
2
Off-Topic General / Re: Stormeus Look Here
« on September 20th, 10:10 PM by Eirone »
forum's nginx software should be updated and Crashes when using '%' ^ + '^% style characters in .ini account system
3
Off-Topic General / Re: Stormeus Look Here
« on September 20th, 10:06 PM by KadirYigit »
Quote from Athanatos on September 1st, 11:19 PM
Seriously? By your post history, you seem to be the generic VC:MP script kiddie.

About yout post: First of all, you should provide details. Don't ask to ask, just ask.
You may read this: https://sol.gfxile.net/dontask.html

TL:DR: Your post can be interpeted as:
Code: [Select]
I found a exploit that I'm too lazy to even explain and too lazy to prove that it exists.

Second of all, VC:MP itself is full of explots, memory leaks, bugs - you name it.

Finally, VC:MP devs are inactive, God knows what they're up to.
Some respect ?
4
Servers / [A/D] Re: Empire Gaming - Attack & Defense
« on September 20th, 06:37 AM by DizzasTeR »
A few quick notifications!

- Discord has been completely re-done with server wcho! (Invite link in first post)
- Forum is back online! (Check first post for link!)
5
Quote from habi on September 19th, 05:44 PM
link not working.
Topic Updated Added Codes here.
Quote from habi on September 19th, 05:44 PM
imagine player going to some place and press some button. A simple menu appears. It has images of each skin......
I can make as well as i already made a topic before here's link:
https://forum.vc-mp.org/?topic=7850.0

if you need more beautiful or any Help so you can dm me on discord.
here's my discord ID: iNForSir#7490
Quote from habi on September 19th, 05:44 PM
I recently found that if player.Team=255 for two players and if one player shoots another, the health of the second player will be reduced. So team id 255 is 'no team'.
team 255 = Free Team
Free team = Can kill each other
6
link not working.
nice work.
imagine player going to some place and press some button. A simple menu appears. It has images of each skin......

I recently found that if player.Team=255 for two players and if one player shoots another, the health of the second player will be reduced. So team id 255 is 'no team'.
7
Quote from Shy on September 19th, 12:35 PM
1: What does this basically does( I understand but noobs won't)? We can also add the same sentence in ScriptLoad rather than database. So elaborate more what's the ease of it rather than putting in onScriptLoad( for noobs).
Its easy to use instead of getting axis of player pos/angle pos then copy paste it in scripts.
Quote from Shy on September 19th, 12:35 PM
2: You have added stats[ player.ID ].Level, so if someone directly copy pastes the script so he/she will get errors about it. ( ex blank vcmp server ) so better remove it.
I will remove it
Quote from Shy on September 19th, 12:35 PM
3: You haven't provided the requires function which you used ( GetTok ) so if someone directly copy pastes, he'll get the GetTok index error.
Well these Gettoks are common things so i didn't added.
8
Quote from Shy on September 19th, 03:21 PM
@MEGAMIND,can you grant access if repo is setup, 'SHy353' or 'Shy353'.
9
1: What does this basically does( I understand but noobs won't)? We can also add the same sentence in ScriptLoad rather than database. So elaborate more what's the ease of it rather than putting in onScriptLoad( for noobs).

2: You have added stats[ player.ID ].Level, so if someone directly copy pastes the script so he/she will get errors about it. ( ex blank vcmp server ) so better remove it.

3: You haven't provided the requires function which you used ( GetTok ) so if someone directly copy pastes, he'll get the GetTok index error.

After all that, nice work.
10
In Game addclass via cmd with Database
Credits: EnForcer


Commands: /addclass <Team ID> <R> <G> <B> <Skin ID>


Extra Note: If you encounter any bug, inform me here or on discord my ID : iNForSir#7490

Paste it in onscriptload
Code: [Select]
db <- ConnectSQL( "Classes.db" );
QuerySQL(db, "CREATE TABLE IF NOT EXISTS Creation ( Team NUMERIC, Skin NUMERIC, X NUMERIC, Y NUMERIC, Z NUMERIC, R NUMERIC, G NUMERIC, B NUMERIC, Angle NUMERIC)" );
LoadClass();

Function to Loadclass
Code: [Select]
function LoadClass()
{
local q = QuerySQL( db, "SELECT * FROM Creation" ), i = 0;
while( GetSQLColumnData( q, 0 ) )
{
local
Team= GetSQLColumnData( q, 0 ),
Skin= GetSQLColumnData( q, 1 ),
X= GetSQLColumnData( q, 2 ),
Y= GetSQLColumnData( q, 3 ),
Z= GetSQLColumnData( q, 4 ),
R= GetSQLColumnData( q, 5 ),
G= GetSQLColumnData( q, 6 ),
B= GetSQLColumnData( q, 7 ),
Angle= GetSQLColumnData( q, 8 );
AddClass( Team, RGB( R,G,B ), Skin, Vector( X,Y,Z ), Angle, 21, 999 ,1, 1, 25, 255 );
GetSQLNextRow( q );
i++;
}
print("Class Count ("+i+")");
return 0;
}

Paste it in onplayercommand
Code: [Select]

else if (cmd=="addclass")
{
if ( !player.IsSpawned ) MessagePlayer( "[#ff0000][Error] - [#ffffff]You need be spawned to use this command.", player );
else if( !text ) MessagePlayer( "[#ff0000][Error] - [#ffffff]Use /"+cmd+" <Team ID> <R> <G> <B> <Skin ID>.", player);
else {
local TeamID = GetTok( text, " ", 1 );
local R = GetTok( text, " ", 2 );
local G = GetTok( text, " ", 3 );
local B = GetTok( text, " ", 4 );
local SkinID = GetTok( text, " ", 5 );
if (!IsNum(TeamID)) MessagePlayer( "[#ff0000][Error] - [#ffffff]Use /"+cmd+" <Team ID> <R> <G> <B> <Skin ID>.", player);
else if ( !IsNum(R)) MessagePlayer( "[#ff0000][Error] - [#ffffff]Use /"+cmd+" <Team ID> <R> <G> <B> <Skin ID>.", player);
else if ( !IsNum(G)) MessagePlayer( "[#ff0000][Error] - [#ffffff]Use /"+cmd+" <Team ID> <R> <G> <B> <Skin ID>.", player);
else if ( !IsNum(B)) MessagePlayer( "[#ff0000][Error] - [#ffffff]Use /"+cmd+" <Team ID> <R> <G> <B> <Skin ID>.", player);
else if ( !IsNum(SkinID)) MessagePlayer( "[#ff0000][Error] - [#ffffff]Use /"+cmd+" <Team ID> <R> <G> <B> <Skin ID>.", player);
else if ( ( !TeamID ) || ( !R ) || (!G ) || ( !B ) || ( !SkinID ) ) MessagePlayer( "[#ff0000][Error] - [#ffffff]Use /"+cmd+" <Veh/ID> <Col1/ID> <Col2/ID> <World> <Price>.", player);
else {
QuerySQL( db, "INSERT INTO Creation ( Team, Skin, R, G, B, X, Y, Z, Angle ) VALUES ( '"+TeamID+"', '"+SkinID+"', '"+R+"', '"+G+"', '"+B+"', '"+player.Pos.x+"', '"+player.Pos.y+"', '"+player.Pos.z+"', '"+player.Angle+"' )" );
AddClass( TeamID.tointeger(), RGB( R.tointeger(), G.tointeger(), B.tointeger() ) ,SkinID.tointeger(), player.Pos, player.Angle, 22, 999 ,17, 100, 21, 245 );
Message( "[#FFFFFF]Admin [#FF0000]"+player.Name+" [#FFFFFF]Has added a new Class." );
     }
     }
return 0;
}

else if ( cmd == "removeclass" )
    {
if ( !text ) MessagePlayer( "[#ff0000][Error] - [#ffffff]Use /"+cmd+" <Skin ID>.", player);
else if (!IsNum(text)) MessagePlayer( "[#ff0000][Error] - [#ffffff]Skin ID must be in numbers.", player);
else {   
local q = QuerySQL( db, "SELECT * FROM Creation WHERE Skin='"+text+"'" );
if ( !q ) MessagePlayer( "[#ff0000][Error] - [#ffffff]Skin ID "+text+" not found in class.", player );
else {
QuerySQL( db, "DELETE FROM Creation WHERE Skin='"+text+"'" );
Message( "[#FFFFFF]Admin [#FF0000]"+player.Name+" [#FFFFFF]Has removed Class." );
     }
     }
return 0;
}