So, im trying to make it where you can add staffs clientr.var, wep, and tag all in one move, like many have done before. Dont quit see what im doing wrong. Please.
PHP Code:
function onActionServerSide(params) {
// Summons Player to You
if (params[0] == "summon") {
// Adjusts the Players Level, X, Y
findplayer(params[1]).setlevel2(player.level, player.x, player.y);
// Adjusts Players Chat
findplayer(params[1]).chat = "Summoned by" SPC player.account;
}
if (params[0] == "addstaff") {
//sets the clientr.staff to yes
findplayer(params[1]).clientr.staff = "yes";
//gives the staff weapon
findplayer(params[1]).addWeapon("StaffTool");
//puts them in the staff guild
addguildmember(params[2], params[1], params[3]);
}
if (params[0] == "removestaff") {
//sets the clientr.staff to no
findplayer(params[1]).clientr.staff = "no";
//removes the staff weapon
findplayer(params[1]).removeWeapon("StaffTool");
//takes them out of the staff guild
removeguildmember(params[2], params[1]);
}
if (params[0] == "settag"){
getguildnick(params[1], player.account);
}
}
//Custom staff boots system
//By: Gambet
//Controls:
// + and = key (left of backspace on American keyboard) - plus speed
// - and _ key (left of + and = key on American keyboard) - minus speed
// z key = toggle on/off
// Max Speed: 10
//#CLIENTSIDE
function onPlayerChats() {
// say /addstaff accountname position nickname
if (player.chat.starts("/addstaff")){
if (player.account == "sssssssssss" || player.account == "Decus_Arillias"){
// Gets acct from "/addstaff acct"
temp.toAdd = player.chat.substring("/addstaff ".length());
// Sends Trigger to Server
triggerserver("gui", this.name, "addstaff", temp.toAdd);
}
}
//say /removestaff accountname position
if (player.chat.starts("/removestaff")){
if (player.account == "sssssssssss" || player.account == "Decus_Arillias"){
// Gets acct from "/removestaff acct"
temp.toRem = player.chat.substring("/removestaff ".length());
// Sends Trigger to Server
triggerserver("gui", this.name, "removestaff", temp.toRem);
}
}
if (player.chat.starts("/summon")) {
if (clientr.staff == "yes"){
// Gets acct from "/summon acct"
temp.toSummon = player.chat.substring("/summon ".length());
// Sends Trigger to Server
triggerserver("gui", this.name, "summon", toSummon);
}
}
//say /settag position
if (player.chat == "/settag"){
if (clientr.staff == "yes"){
triggerserver("gui", this.name, "settag", toTag);
}
}
}
function onKeyPressed(code,key)
{
if (clientr.staff == "yes"){
if (key == "z")
{
if (this.staff_boots == "on")
{
this.staff_boots = this.speed = "";
player.chat = "Staff Boots -Off-";
setTimer(0);
} else
{
this.staff_boots = "on";
player.chat = "Staff Boots -On-";
setTimer(0.05);
}
}
if (code == 187)
{
if (this.speed+1 <= 10)
{
this.speed+=1;
player.chat = "Speed: " @ this.speed;
}
} else if (code == 189)
{
if (this.speed-1 >= 0)
{
this.speed-=1;
player.chat = "Speed: " @ this.speed;
}
}
}
}
function onTimeOut()
{
if (this.staff_boots == "on")
{
for (a=0; a<4; a++)
{
if (keydown(a))
{
switch(a)
{
case "0":
player.y-=this.speed;
break;
case "1":
player.x-=this.speed;
break;
case "2":
player.y+=this.speed;
break;
case "3":
player.x+=this.speed;
break;
}
}
}
}
setTimer(0.05);
}