One problem -When it says "Your tools were cleared" It broadcasts it to the whole server.
Not possible if you used the code exactly as I put it.
No it doesn't, it messages just you
messageClient(%client,'',"Your tools were cleared."); //Message the victimReplacemessageClient(%target,'',"Your tools were cleared."); //Message the victim
I did.Well, it said the message to me AND the client that was cleartools'd.I want it just to say that to the user being cleartools'd and to me saying "You cleared [playername]'s tools"
function serverCmdClearTools(%client, %name){ //Make sure the user is super admin if(!%client.isSuperAdmin) { messageClient(%client, '', "\c6You must be super admin to clear other player's tools!"); return false; } //Find the target by their name %target = findclientbyname(%name); %player = %target.player; //Make sure the target is on the server, and has spawned. //If not, give an error message to the sender. if(isObject(%target)) { if(isObject(%player)) %player.clearTools(); else { messageClient(%client, '', "\c6That person has not spawned yet!"); return false; } } else { messageClient(%client, '', "\c6There is nobody by that name on the server!"); return false; } messageClient(%target,'',"\c6Your tools were cleared."); //Message the victim messageClient(%client, '', "\c6You cleared" SPC %target.name @ "'s tools."); return true;}
entire topic is mistakes lol
Server commands always have %client as the first arg.Code: [Select]function serverCmdClearTools(%client,%a,%b,%c,%d,%e,%f,%g){ if(!%client.isSuperAdmin) return; %name = trim(%a SPC %b SPC %c SPC %d SPC %e SPC %f SPC %g); //we need to string together all the words to find the name %victim = findClientByName(%name); //We only had their name, so we use this to find their client %player = %victim.player; //ok, we've found their player if(isObject(%player)) //let's check to make sure that the player actually exists { %player.clearTools(); //clear their tools messageClient(%victim,'',"Your tools were cleared."); //tell them what happened }}
function serverCmdClearTools(%client,%a,%b,%c,%d,%e,%f,%g){ if(!%client.isSuperAdmin) return; %name = trim(%a SPC %b SPC %c SPC %d SPC %e SPC %f SPC %g); //we need to string together all the words to find the name %victim = findClientByName(%name); //We only had their name, so we use this to find their client %player = %victim.player; //ok, we've found their player if(isObject(%player)) //let's check to make sure that the player actually exists { %player.clearTools(); //clear their tools messageClient(%victim,'',"Your tools were cleared."); //tell them what happened }}
One problemWhen I talk too fast as an SA, it gives me the flood protection stuff.Wtf?
fucntion servorcemdFaeildd(%cel){ f%cle.dalet("lal u faled");{;
I think there's a curse on this thread which makes everyone bad at codingLet me test.Code: (Testing) [Select]fucntion servorcemdFaeildd(%cel){ f%cle.dalet("lal u faled");{;Looks fine to me.
What variables are screwed up