Hey guys
I have decided to post up a simple script that people can use which acts as a template for those wishing to create their own punishment type or rcon based commands onto players.
Examples such as:
- Kill the player
- Random change players name
- Reset score
Basically the script below is blank atm and does not do anything, it is up to you to fill in the blanks to suit your needs.
////// TEMPLATE FOR RCON COMMAND ON PLAYER
// USAGE:
// rcon CVAR <clientnum>
// This is for single commands on players ONLY, no values to be passed EXCEPT playerID
main:
if(level.customcommand1) /// Change number as you go
end
level.customcommand1 = 1 /// Again change number to same as above
local.cvar = "test" /// << THIS IS WHERE YOU CHANGE IT TO YOUR GIVEN CVAR YOU WISH TO USE
///////////////////////////////////////////////////////////////////////////////////
while(1)
{
setcvar local.cvar ""
while(getcvar local.cvar == "")
wait 1
local.num = getcvar local.cvar
local.player = waitthread convert local.num
if(local.player != 0 && local.player != NULL && local.player != NIL)
{
thread command local.player
}
else
{
println("--Error - No such player --- ")
}
}
end
convert local.num:
for(level.who = 1;level.who <= $player.size;level.who++)
{
if($player[level.who].entnum == int(local.num))
{
end $player[level.who]
}
}
level.who = -1 //no such client
end 0
//////////////////////////////^^^^^ DO NOT CHANGE ^^^^^//////////////////////////////////////////////
command local.player:
///////////// THIS IS WHERE YOU ADD THE CODE THAT YOU WISH TO USE ON THE PLAYER
///////////// PLAYER IS local.player
end