Vice City: Multiplayer

Server Development => Scripting and Server Management => Script Showroom => Topic started by: MRSK143 on Jun 22, 2021, 05:23 PM

Title: Reward System
Post by: MRSK143 on Jun 22, 2021, 05:23 PM
Hi Guyz I Made Simple Reward System ;D

Warning You Can Use This CMD Only Using My Staff Level System
Staff Level System Link:
https://forum.vc-mp.org/?topic=8560.new#new

Here The Cmd Add This Into onPlayerCommand

else if( cmd == "reward" )
{
if( Admin[ player.ID ] == true )
{
if ( text )
{
local plr = GetPlayer( GetTok( text, " ", 1 ) ), ammount = GetTok( text, " ", 2 );
ammount = ammount.tointeger();
if ( !plr )
{
if( !IsNum( ammount ) )
{
plr.GiveMoney(ammount.tointeger());
Message( "[#FFbb00]** Admin " + player.Name + " Has Rewarded "+plr.Name+" Ammount "+ammount  ");
}
else MessagePlayer( "[#db0000]Money Must Be Integer.", player );
}
else MessagePlayer("[#db0000]Unknown player.", player);
}
else MessagePlayer("Syntax; /reward <player Name> <ammount>.", player);
}
else MessagePlayer("[#db0000]Unknown command.", player);
}

Title: Re: Reward System
Post by: DizzasTeR on Jun 23, 2021, 02:41 AM
So everyone can set anyone's admin status, I think thats not quite right
Title: Re: Reward System
Post by: MRSK143 on Jun 23, 2021, 06:41 AM
Quote from: DizzasTeR on Jun 23, 2021, 02:41 AMSo everyone can set anyone's admin status, I think thats not quite right
Updated The Code
Title: Re: Reward System
Post by: Jutt on Jul 04, 2021, 08:35 PM
bro give me reward system without level system plz
Title: Re: Reward System
Post by: Gito Baloch on Jul 11, 2021, 06:09 AM
Quote from: Jutt on Jul 04, 2021, 08:35 PMbro give me reward system without level system plz

Without Level/Admin Systemelse if( cmd == "reward" )
{
if ( text ) MessagePlayer("[#ff0000]Error: "/reward <plr> <ammount>"", player);
{
local plr = GetPlayer( GetTok( text, " ", 1 ) ), cash = GetTok( text, " ", 2 );
cash = ammount.tointeger();
if ( !plr ) MessagePlayer("[#ff0000]Error: Unknown player.", player);
{
if( !IsNum( cash ) ) MessagePlayer( "[#ff0000]Error: Money Must Be Integer.", player );
{
plr.GiveMoney(cash.tointeger());
Message( "[#ffffff]"+ player.Name + "[#ff0000] has rewarded [#ffffffff]"+plr.Name+"[#ff0000] With Ammount[#ffffff] "+cash+".");
}
}
}
}


With Level/Admin Systemelse if( cmd == "reward" )
{
if (stats[player.ID].Level < 2 ) MessagePlayer("[#ff0000]Error: Access Denied.",player);
else if ( text ) MessagePlayer("[#ff0000]Error: "/reward <plr> <ammount>"", player);
{
local plr = GetPlayer( GetTok( text, " ", 1 ) ), cash = GetTok( text, " ", 2 );
cash = ammount.tointeger();
if ( !plr ) MessagePlayer("[#ff0000]Error: Unknown player.", player);
{
if( !IsNum( cash ) ) MessagePlayer( "[#ff0000]Error: Money Must Be Integer.", player );
{
plr.GiveMoney(cash.tointeger());
Message( "[#ffffff]"+ player.Name + "[#ff0000] has rewarded [#ffffffff]"+plr.Name+"[#ff0000] With Ammount[#ffffff] "+cash+".");
}
}
}
}