Author Topic: Scripting Help  (Read 487 times)

I am trying to make a script that says -Client- Needs to stop spamming when the Host or SuperAdmin says /StopSpam -BLID-

Problem: it wont appear on the custom add-ons list, it does appear on the GRTB listings though.  Even though it is activated on the GRTB listings, it doesnt work in game.

Script

function servercmdStopSpam(%admin, %blid)
{
  if(!%admin. issuperadmin) return;
  %target = getclientbyid(%blid);
  if(%target == -1) return;
  messageall("\c5needs to stop spamming, " @ %target.name @ ");
}
ActivatePackage(StopSpam);

You should work on how you write out your script. But I already see one syntax error, and be sure you have a description.txt

Good practice for writing out the code would be to make it look something like:
Code: [Select]
function servercmdStopSpam(%admin, %blid)
{
  if(!%admin.issuperadmin)
    return;
  %target = getclientbyid(%blid);
  if(!isObject(%target))
    return;
  messageall('',"\c5"@%target.name SPC "\c5needs to stop spamming.");
}
ActivatePackage(StopSpam);
Your error is that you're doing !%admin. isSuperAdmin and adding in a space after %admin. when it should read !%admin.isSuperAdmin
I'd also like to note that messageAll has two arguments, the first being sound and the second being the message.

Also remove the activatePackage. That code isn't in a package, nor does it need to be. Also it's findClientByBL_ID.