Author Topic: Making /commands HELP  (Read 2269 times)

Ello Everyone Can Someone Post A Link/ Tutorial On How To Make /Commands like /sword gives a sword? Please Im Working On A Mod But Stuck At This

commandtoserver('command');

blockland auto makes those into slash commands...

commandtoserver('command');

blockland auto makes those into slash commands...
umm what?

you dont need a script to make a /command
if you have a commandtoserver('???'); it makes it a / command auto...
so like "commandtoserver('clearbricks'); does the same thing as /clearbricks"

...
He wants to add MORE slash commands.
not execute them as a client.

Code: [Select]
function servercmdcookies(%client,%amount){
//yourcodehere
if(!$cookies){$cookies=getrand(1,5);}
$cookies-=%amount;
announce(%client.name SPC "\c1eats" SPC %amount SPC "cookies,\c0" SPC $cookies SPC "\c1are left in the jar!");
}
simple command to eat cookies
/cookies 3
Rky eats 3 cookies, # are left in the jar!
# because it sets the number to a random one.

ah i thought he was asking on how to make one "slash command" not a server command

Hey Thanks Guy But Rh Can You Give Me An Example For The /sword Thing im not much of a scripter for Retail I Used To Script For RTB So  I Need To Get Used To Retails Coding

its the same type of code.....

Don't Type Like This Please.

Code: [Select]
function servercmdsword(%client){
         %client.player.tool[4] = nametoID(SwordItem);
messageClient(%client, 'MsgItemPickup', '', 4, nametoID(SwordItem));}
I believe that will work.

Ok I Got That But And Made More Commands But For Some Reason It Doesnt Work The /Sword One Heres The Script Part

Code: [Select]
function serverCmdEditAdminList(%Client,%Selected,%Type)
{
if(%Client.bl_id $= $Pref::Server::Host && %Selected.bl_id !$= $Pref::Server::Host)
{
switch$(%Type)
{
case "SuperAdmin":
serverCmdSAD(%Selected,$Pref::Server::SuperAdminPassword);
case "unSuperAdmin":
if(%Selected.isSuperAdmin && %Selected.bl_id != $Pref::Server::Host)
{
%Selected.isSuperAdmin = 0;
%Selected.isAdmin = 0;
UpdatePlayList();
messageAll('','\c2%1 has been UnSupered by host',%Selected.name);
}
case "Admin":
serverCmdSAD(%Selected,$Pref::Server::AdminPassword);
case "unAdmin":
if(%Selected.isAdmin && !%Selected.isSuperAdmin && %Selected.bl_id != $Pref::Server::Host)
{
%Selected.isAdmin = 0;
UpdatePlayList();
messageAll('','\c2%1 has been UnAdmined by host',%Selected.name);
}
}
}
else
{
CommandToClient(%Client,'CenterPrint',"You are not the host or you tried to unadmin yourself",2);
}
}

function servercmdrouge(%client){
         %client.player.tool[4] = nametoID(kunaiItem);
messageClient(%client, 'MsgItemPickup', '', 4, nametoID(kunaiItem));}

function servercmdranger(%client){
         %client.player.tool[4] = nametoID(bowItem);
messageClient(%client, 'MsgItemPickup', '', 4, nametoID(bowItem));}

function servercmdwizard(%client){
         %client.player.tool[4] = nametoID(SparklerItem);
messageClient(%client, 'MsgItemPickup', '', 4, nametoID(SparklerItem));}

function servercmdsword(%client){
         %client.player.tool[4] = nametoID(SwordItem);
messageClient(%client, 'MsgItemPickup', '', 4, nametoID(SwordItem));}