Ok here's the serverside with all in it. I never used the restricted argument in addCMDHandler, but it should work... still it's better to test. If testing of the first function result in a "fail", then use the second variant.
function nameThatFunction( playerSource, cmd, ... )
local pX, pY, pZ = getElementPosition ( playerSource )
createExplosion ( pX+3, pY+3, pZ, 2 )
createExplosion ( pX-3, pY-3, pZ, 2 )
createExplosion ( pX+5, pY-2, pZ, 2 )
createExplosion ( pX-4, pY+4, pZ, 2 )
end
addCommandHandler( "rob", nameThatFunction, true)
--that true means the resource is restricted, so only if a player is in a group with the access to command.rob that command will be executed
--since i NEVER used the restricted argument, here's the variant with the check inside the function
function nameThatFunction( playerSource, cmd, ... )
if hasObjectPermissionTo(playerSource,"command.rob") then
local pX, pY, pZ = getElementPosition ( playerSource )
createExplosion ( pX+3, pY+3, pZ, 2 )
createExplosion ( pX-3, pY-3, pZ, 2 )
createExplosion ( pX+5, pY-2, pZ, 2 )
createExplosion ( pX-4, pY+4, pZ, 2 )
end
end
addCommandHandler( "rob", nameThatFunction)
EDIT: lol i noticed that the second variant is already posted, sorry for the duplicate.